Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7044 in orxonox.OLD for trunk/src/world_entities


Ignore:
Timestamp:
Feb 6, 2006, 2:09:01 AM (18 years ago)
Author:
patrick
Message:

trunk: death screen now works

Location:
trunk/src/world_entities
Files:
2 edited

Legend:

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

    r7014 r7044  
    2727#include "power_ups/param_power_up.h"
    2828
     29#include "game_rules.h"
    2930
    3031#include "dot_emitter.h"
     
    136137
    137138
    138 void Playable::die()
    139 {
    140     //this->deactivateNode();
    141   this->toList(OM_DEAD);
    142   this->emitter->setSystem(explosionParticles);
    143   this->setAbsCoor(0, 0, 0);
    144     //this->setAbsDir(Vector(1,0,0), 0);
    145   this->emitter->setSystem(NULL);
    146 
     139void Playable::respawn()
     140{
     141  PRINTF(0)("Playable respawn\n");
     142  // only if this is the spaceship of the player
     143  if( this == State::getPlayer()->getPlayable())
     144    State::getGameRules()->onPlayerSpawn();
     145
     146  this->setAbsCoor(0.0, 0.0, 0.0);
    147147
    148148  if( this->getOwner()%2 == 0)
     
    150150  else
    151151    this->toList(OM_GROUP_01);
     152}
     153
     154
     155void Playable::die()
     156{
     157  PRINTF(0)("Playable dies\n");
     158  // only if this is the spaceship of the player
     159  if( this == State::getPlayer()->getPlayable())
     160    State::getGameRules()->onPlayerDeath();
     161
     162  this->toList(OM_DEAD);
     163  //.HACK: moves the entity to an unknown place far far away: in the future, GameRules will look for that
     164  this->setAbsCoor(-2000.0, -2000.0, -2000.0);
     165
     166  //explosion hack
     167  this->emitter->setSystem(explosionParticles);
     168  this->setAbsCoor(0, 0, 0);
     169  this->emitter->setSystem(NULL);
    152170}
    153171
  • trunk/src/world_entities/playable.h

    r6994 r7044  
    3030
    3131    virtual void die();
     32    virtual void respawn();
    3233
    3334    virtual bool pickup(PowerUp* powerUp);
Note: See TracChangeset for help on using the changeset viewer.