src/Player.cc
changeset 271 bf6784a95b08
parent 270 d17126e20de7
child 272 97de051edbcf
equal deleted inserted replaced
270:d17126e20de7 271:bf6784a95b08
    39     // XXX: this should be a PhysicsObject constructor arg
    39     // XXX: this should be a PhysicsObject constructor arg
    40     collision_elasticity = PLAYER_COLLISION_ELASTICITY;
    40     collision_elasticity = PLAYER_COLLISION_ELASTICITY;
    41 }
    41 }
    42 
    42 
    43 void Player::handleDig (Vector position, float radius) {
    43 void Player::handleDig (Vector position, float radius) {
    44     // XXX: clean this bit up
       
    45     // calculate new position and velocity
    44     // calculate new position and velocity
    46     Vector digPosition = position + getDirection() * PROJECTILE_START_DISTANCE;
    45     Vector digPosition = position + getDirection() * PROJECTILE_START_DISTANCE;
       
    46     
       
    47     // remove directly
    47     world.removeGround(digPosition, radius);
    48     world.removeGround(digPosition, radius);
    48     // execute
       
    49     //    new Projectile(state, shotPosition, Vector(0, 0), false, radius, 0);
       
    50 }
    49 }
    51 
    50 
    52 void Player::handleCreateProjectile (Weapon *weapon, Vector position, Vector velocity) {
    51 void Player::handleCreateProjectile (Weapon *weapon, Vector position, Vector velocity) {
    53     new Projectile(state, position, velocity, true, weapon->getExplosionRadius(), weapon->getRadius(), weapon->getExpireTicks());
    52     new Projectile(state, position, velocity, weapon);
    54 }
    53 }
    55         
    54         
    56 void Player::handleChangeWeapon (unsigned int weaponIndex) {
    55 void Player::handleChangeWeapon (unsigned int weaponIndex) {
    57     assert(weaponIndex < weapons.size());
    56     assert(weaponIndex < weapons.size());
    58 
    57