- Timestamp:
- Feb 8, 2006, 9:59:21 AM (19 years ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/util/multiplayer_team_deathmatch.cc
r7116 r7118 184 184 } 185 185 186 186 187 187 if ( SharedNetworkData::getInstance()->isGameServer() ) 188 188 { … … 190 190 float offsety = 323.0f; 191 191 float offsetz = 200.0f; 192 192 193 193 offsetz += 10; 194 194 195 195 Terrain * terrain = dynamic_cast<Terrain*>(*(ClassList::getList( CL_TERRAIN )->begin())); 196 196 const std::list<BaseObject*> * list = ClassList::getList( CL_SPACE_SHIP ); … … 209 209 //PRINTF(0)("x = %f, y = %f, z = %f, height = %f\n", terrx, terry, terrz, terrain->getHeight( terrx, terry )); 210 210 //ss->setRelCoorSoft( ss->getAbsCoor().x, terrain->getHeight( terrx, terry )-offsety, ss->getAbsCoor().z ); 211 211 212 212 float dist = (dynamic_cast<Playable*>(*it)->getAbsCoor() - big_left).len(); 213 213 if( (dynamic_cast<Playable*>(*it)->getAbsCoor() - big_left).len() > rBig && … … 215 215 (dynamic_cast<Playable*>(*it)->getAbsCoor() - small_left).len() > rSmall && 216 216 (dynamic_cast<Playable*>(*it)->getAbsCoor() - small_middle).len() > rSmall && 217 (dynamic_cast<Playable*>(*it)->getAbsCoor() - small_right).len() > rSmall) 217 (dynamic_cast<Playable*>(*it)->getAbsCoor() - small_right).len() > rSmall 218 && ss->getAbsCoor().x > -1000) 218 219 { 219 220 PRINTF(0)("KILLLLLLLL\n"); … … 221 222 if((*it)->isA(CL_SPACE_SHIP)) 222 223 { 223 dynamic_cast<SpaceShip*>(*it)->networkCollisionList.push_back(1163692 20.33434f);224 dynamic_cast<SpaceShip*>(*it)->doCollideNetwork(11636922 0.33434f);224 dynamic_cast<SpaceShip*>(*it)->networkCollisionList.push_back(1163692); 225 dynamic_cast<SpaceShip*>(*it)->doCollideNetwork(11636922); 225 226 } 226 227 } -
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.