Changeset 7118 in orxonox.OLD for trunk/src/world_entities
- Timestamp:
- Feb 8, 2006, 9:59:21 AM (19 years ago)
- Location:
- trunk/src/world_entities
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/playable.cc
r7100 r7118 33 33 #include "sprite_particles.h" 34 34 35 #include "effects/explosion.h" 36 35 37 36 38 Playable::Playable() … … 53 55 this->oldScore = 0; 54 56 55 56 this->emitter = new DotEmitter(100, 5, M_2_PI); 57 this->emitter->setParent(this); 58 this->emitter->setSpread(M_PI, M_PI); 59 this->emitter->setEmissionRate(300.0); 60 this->emitter->setEmissionVelocity(50.0); 61 62 this->explosionParticles = new SpriteParticles(1000); 63 this->explosionParticles->setName("LaserExplosionParticles"); 64 this->explosionParticles->setLifeSpan(.5, .3); 65 this->explosionParticles->setRadius(0.0, 10.0); 66 this->explosionParticles->setRadius(.5, 6.0); 67 this->explosionParticles->setRadius(1.0, 3.0); 68 this->explosionParticles->setColor(0.0, 1,1,0,.9); 69 this->explosionParticles->setColor(0.5, .8,.8,0,.5); 70 this->explosionParticles->setColor(1.0, .8,.8,.7,.0); 57 this->bDead = false; 71 58 } 72 59 … … 156 143 State::getGameRules()->onPlayerSpawn(); 157 144 158 this->reset();159 160 145 161 146 if( this->getOwner() % 2 == 0) … … 171 156 this->setAbsDir(1.0, -0.015, -0.012, 0.011); 172 157 } 158 this->reset(); 159 this->bDead = false; 173 160 } 174 161 … … 177 164 void Playable::die() 178 165 { 179 PRINTF(0)("Playable dies\n"); 166 if( !this->bDead) 167 { 168 PRINTF(0)("Playable dies\n"); 180 169 // only if this is the spaceship of the player 181 if (State::isOnline())182 {183 if( this == State::getPlayer()->getPlayable())184 State::getGameRules()->onPlayerDeath();185 186 170 if (State::isOnline()) 171 { 172 if( this == State::getPlayer()->getPlayable()) 173 State::getGameRules()->onPlayerDeath(); 174 175 Explosion::explode(dynamic_cast<PNode*>(this), Vector(1.0f, 1.0f, 1.0f)); 187 176 // this->toList(OM_GROUP_05); 188 177 //HACK: moves the entity to an unknown place far far away: in the future, GameRules will look for that 189 this->setAbsCoor(-2000.0, -2000.0, -2000.0);178 this->setAbsCoor(-2000.0, -2000.0, -2000.0); 190 179 191 180 //explosion hack 192 this->emitter->setSystem(explosionParticles); 193 this->emitter->setSystem(NULL); 181 182 } 183 this->bDead = true; 194 184 } 195 185 } -
trunk/src/world_entities/playable.h
r7092 r7118 18 18 class Player; 19 19 class SpriteParticles; 20 class Explosion; 20 21 21 22 //! Basic controllable WorldEntity … … 90 91 int oldScore; 91 92 93 bool bDead; 94 92 95 //TODO HACK: explosion emitter 93 DotEmitter* emitter; 94 SpriteParticles* explosionParticles; 96 95 97 96 98 WorldEntity* collider;
Note: See TracChangeset
for help on using the changeset viewer.