src/Player.cc
changeset 302 e734d8e9bbb5
parent 300 417183866f35
child 307 5b4806c61342
equal deleted inserted replaced
301:02ad02d28245 302:e734d8e9bbb5
    66 
    66 
    67     // enable
    67     // enable
    68     enable();
    68     enable();
    69 }
    69 }
    70 
    70 
    71 void Player::die (void) {
    71 void Player::die (bool start_timer) {
       
    72     // we don't have a rope anymore
       
    73     rope.release();
       
    74 
    72     // disable our PhysicsObject
    75     // disable our PhysicsObject
    73     disable();
    76     disable();
    74     
    77 
    75     // start respawn timer
    78     // XXX: PhysicsObject::reset
    76     respawn_timer.fire_once();
    79     this->velocity = Vector(0, 0);
       
    80     
       
    81     if (start_timer) {
       
    82         // start respawn timer
       
    83         respawn_timer.fire_once();
       
    84     }
    77 }
    85 }
    78 
    86 
    79 void Player::respawn (TimeMS dt) {
    87 void Player::respawn (TimeMS dt) {
    80     (void) dt;
    88     (void) dt;
    81 
    89 
    82     // reset health
    90     // reset health
    83     health = PLAYER_HEALTH;
    91     health = PLAYER_HEALTH;
       
    92 
       
    93     // XXX: reload weapons
    84 
    94 
    85     // XXX: ...
    95     // XXX: ...
    86     spawn(Vector(PLAYER_INITIAL_X, PLAYER_INITIAL_Y));
    96     spawn(Vector(PLAYER_INITIAL_X, PLAYER_INITIAL_Y));
    87 }
    97 }
    88 
    98