Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6436 in orxonox.OLD for trunk/src


Ignore:
Timestamp:
Jan 8, 2006, 2:27:29 AM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: collides with function now takes away the Energy of our beloved Entity

Location:
trunk/src/world_entities
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/playable.cc

    r6241 r6436  
    5252  // the reference to the Current Player is NULL, because we dont have one at the beginning.
    5353  this->currentPlayer = NULL;
     54}
     55
     56/**
     57 * @brief helps us colliding Playables
     58 */
     59void Playable::collidesWith(WorldEntity* entity, const Vector& location)
     60{
     61  if (entity->isA(CL_PROJECTILE))
     62    this->removeEnergy(entity->getEnergy());
     63
     64  // EXTREME HACK
     65  if (this->getEnergy() == 0.0f)
     66    this->deactivateNode();
    5467}
    5568
  • trunk/src/world_entities/playable.h

    r6241 r6436  
    3838    void detachCamera();
    3939
     40    virtual void collidesWith(WorldEntity* entity, const Vector& location);
    4041    virtual void process(const Event &event) = 0;
    4142
  • trunk/src/world_entities/space_ships/space_ship.cc

    r6430 r6436  
    269269void SpaceShip::collidesWith(WorldEntity* entity, const Vector& location)
    270270{
     271  Playable::collidesWith(entity, location);
    271272  if (entity->isA(CL_TURRET_POWER_UP) && entity != ref)
    272273  {
Note: See TracChangeset for help on using the changeset viewer.