src/Player.cc
changeset 335 47dc65c8df71
parent 330 dcc47278e5ab
child 342 4abe994e61d5
equal deleted inserted replaced
334:0cf3f2be51eb 335:47dc65c8df71
   282 
   282 
   283     // Currently we handle only player-player collision here.
   283     // Currently we handle only player-player collision here.
   284     // Player-projectile collision is handled in projectile's onCollision.
   284     // Player-projectile collision is handled in projectile's onCollision.
   285     // XXX: not completely network-safe
   285     // XXX: not completely network-safe
   286     if (other->getType() == PLAYER) {
   286     if (other->getType() == PLAYER) {
   287         Vector normal = this->getPosition() - other->getPosition();
   287         //Vector normal = this->getPosition() - other->getPosition();
   288         this->bounce(normal);
   288         //this->bounce(normal);
   289 
   289 
   290         // Move the player back to its previous position so that players won't
   290         // Move the player back to its previous position so that players won't
   291         // stuff inside each others when having a collision walk, e.g.
   291         // stuff inside each others when having a collision walk, e.g.
   292         this->setPosition(this->getPreviousPosition());
   292         //this->setPosition(this->getPreviousPosition());
   293     }
   293     }
   294 }
   294 }
   295 
   295 
   296 Vector Player::getPivotForce () {
   296 Vector Player::getPivotForce () {
   297     Vector direction = this->pivot->getPosition() - this->getPosition();
   297     Vector direction = this->pivot->getPosition() - this->getPosition();