Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7118 in orxonox.OLD


Ignore:
Timestamp:
Feb 8, 2006, 9:59:21 AM (18 years ago)
Author:
patrick
Message:

trunk: mp explosion

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/util/multiplayer_team_deathmatch.cc

    r7116 r7118  
    184184  }
    185185
    186  
     186
    187187  if ( SharedNetworkData::getInstance()->isGameServer() )
    188188  {
     
    190190    float offsety = 323.0f;
    191191    float offsetz = 200.0f;
    192    
     192
    193193    offsetz += 10;
    194    
     194
    195195    Terrain * terrain = dynamic_cast<Terrain*>(*(ClassList::getList( CL_TERRAIN )->begin()));
    196196    const std::list<BaseObject*> * list = ClassList::getList( CL_SPACE_SHIP );
     
    209209      //PRINTF(0)("x = %f, y = %f, z = %f, height = %f\n", terrx, terry, terrz, terrain->getHeight( terrx, terry ));
    210210      //ss->setRelCoorSoft( ss->getAbsCoor().x, terrain->getHeight( terrx, terry )-offsety, ss->getAbsCoor().z );
    211      
     211
    212212      float dist = (dynamic_cast<Playable*>(*it)->getAbsCoor() - big_left).len();
    213213      if( (dynamic_cast<Playable*>(*it)->getAbsCoor() - big_left).len() > rBig &&
     
    215215           (dynamic_cast<Playable*>(*it)->getAbsCoor() - small_left).len() > rSmall &&
    216216           (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)
    218219      {
    219220        PRINTF(0)("KILLLLLLLL\n");
     
    221222        if((*it)->isA(CL_SPACE_SHIP))
    222223        {
    223           dynamic_cast<SpaceShip*>(*it)->networkCollisionList.push_back(116369220.33434f);
    224           dynamic_cast<SpaceShip*>(*it)->doCollideNetwork(116369220.33434f);
     224          dynamic_cast<SpaceShip*>(*it)->networkCollisionList.push_back(1163692);
     225          dynamic_cast<SpaceShip*>(*it)->doCollideNetwork(11636922);
    225226        }
    226227      }
  • trunk/src/world_entities/playable.cc

    r7100 r7118  
    3333#include "sprite_particles.h"
    3434
     35#include "effects/explosion.h"
     36
    3537
    3638Playable::Playable()
     
    5355  this->oldScore = 0;
    5456
    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;
    7158}
    7259
     
    156143    State::getGameRules()->onPlayerSpawn();
    157144
    158   this->reset();
    159 
    160145
    161146  if( this->getOwner() % 2 == 0)
     
    171156    this->setAbsDir(1.0, -0.015, -0.012, 0.011);
    172157  }
     158  this->reset();
     159  this->bDead = false;
    173160}
    174161
     
    177164void Playable::die()
    178165{
    179   PRINTF(0)("Playable dies\n");
     166  if( !this->bDead)
     167  {
     168    PRINTF(0)("Playable dies\n");
    180169  // 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));
    187176//     this->toList(OM_GROUP_05);
    188177  //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);
    190179
    191180  //explosion hack
    192     this->emitter->setSystem(explosionParticles);
    193     this->emitter->setSystem(NULL);
     181
     182    }
     183    this->bDead = true;
    194184  }
    195185}
  • trunk/src/world_entities/playable.h

    r7092 r7118  
    1818class Player;
    1919class SpriteParticles;
     20class Explosion;
    2021
    2122//! Basic controllable WorldEntity
     
    9091    int                   oldScore;
    9192
     93    bool                  bDead;
     94
    9295    //TODO HACK: explosion emitter
    93     DotEmitter*           emitter;
    94     SpriteParticles*      explosionParticles;
     96
    9597
    9698    WorldEntity* collider;
Note: See TracChangeset for help on using the changeset viewer.