src/Player.cc
changeset 241 e95b1602d836
parent 239 550397d9d479
child 248 e40ef56dc62c
equal deleted inserted replaced
240:e8ca212a2739 241:e95b1602d836
    69     
    69     
    70     // tick current weapon reload
    70     // tick current weapon reload
    71     if (getCurrentWeapon())
    71     if (getCurrentWeapon())
    72         getCurrentWeapon()->tickReload(dt);
    72         getCurrentWeapon()->tickReload(dt);
    73 }
    73 }
       
    74         
       
    75 void Player::handleRopeState (RopeState state) {
       
    76     
       
    77 }
       
    78 
       
    79 void Player::handleRopeLength (float length) {
       
    80 
       
    81 }
    74 
    82 
    75 void LocalPlayer::fireWeapon (Weapon *weapon) {
    83 void LocalPlayer::fireWeapon (Weapon *weapon) {
    76     // update reload timer
    84     // update reload timer
    77     weapon->reload();
    85     weapon->reload();
    78     
    86     
   142 
   150 
   143     // validate shoot events, and then outsource to handleShoot so Network can intercept it
   151     // validate shoot events, and then outsource to handleShoot so Network can intercept it
   144     if ((input & INPUT_SHOOT) && getCurrentWeapon()->canShoot())
   152     if ((input & INPUT_SHOOT) && getCurrentWeapon()->canShoot())
   145         fireWeapon(getCurrentWeapon());
   153         fireWeapon(getCurrentWeapon());
   146     
   154     
   147     // rope throw+release+changeLength
   155     // rope throw+release+changeLength, but supress spurious events
   148     if (input & INPUT_ROPE)
   156     if (input & INPUT_ROPE)
   149         rope.throwRope();
   157         rope.throwRope();
   150 
   158 
   151     if (input & INPUT_UNROPE)
   159     if (input & INPUT_UNROPE && rope.getState() != ROPE_FOLDED)
   152         rope.release();
   160         rope.release();
   153 
   161 
   154     if (input & INPUT_ROPE_UP)
   162     if (input & INPUT_ROPE_UP && rope.getState() == ROPE_FIXED)
   155         rope.changeLength(-ROPE_GROWTH_RATE);
   163         rope.changeLength(-ROPE_GROWTH_RATE);
   156 
   164 
   157     if (input & INPUT_ROPE_DOWN)
   165     if (input & INPUT_ROPE_DOWN && rope.getState() == ROPE_FIXED)
   158         rope.changeLength(ROPE_GROWTH_RATE);
   166         rope.changeLength(ROPE_GROWTH_RATE);
   159 
   167 
   160     // XXX: how should this be written? What does this do? Probably broken under network play
   168     // XXX: how should this be written? What does this do? Probably broken under network play
   161     if (move_force.x != 0) 
   169     if (move_force.x != 0) 
   162         animation_step = (animation_step + 1) % img_num_step;
   170         animation_step = (animation_step + 1) % img_num_step;