Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6950 in orxonox.OLD for branches/network


Ignore:
Timestamp:
Feb 1, 2006, 4:00:56 PM (19 years ago)
Author:
patrick
Message:

network: explosion added

Location:
branches/network/src/world_entities
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/world_entities/playable.cc

    r6937 r6950  
    2828
    2929
     30#include "dot_emitter.h"
     31#include "sprite_particles.h"
     32
     33
    3034Playable::Playable()
    3135{
     
    4347
    4448  this->setSynchronized(true);
     49
     50
     51  this->emitter = new DotEmitter(100, 5, M_2_PI);
     52  this->emitter->setParent(this);
     53  this->emitter->setSpread(M_PI, M_PI);
     54  this->emitter->setEmissionRate(300.0);
     55  this->emitter->setEmissionVelocity(50.0);
     56
     57  this->explosionParticles = new SpriteParticles(1000);
     58  this->explosionParticles->setName("LaserExplosionParticles");
     59  this->explosionParticles->setLifeSpan(.5, .3);
     60  this->explosionParticles->setRadius(0.0, 10.0);
     61  this->explosionParticles->setRadius(.5, 6.0);
     62  this->explosionParticles->setRadius(1.0, 3.0);
     63  this->explosionParticles->setColor(0.0, 1,1,0,.9);
     64  this->explosionParticles->setColor(0.5, .8,.8,0,.5);
     65  this->explosionParticles->setColor(1.0, .8,.8,.7,.0);
    4566}
    4667
     
    106127  // EXTREME HACK
    107128  if (this->getHealth() == 0.0f)
    108     this->deactivateNode();
     129  {
     130    //this->deactivateNode();
     131    this->emitter->setSystem(explosionParticles);
     132    this->setAbsCoor(0, 0, 0);
     133    this->setAbsDir(0, 1, 0);
     134  }
    109135}
    110136
  • branches/network/src/world_entities/playable.h

    r6868 r6950  
    1515
    1616class Weapon;
    17 
     17class DotEmitter;
    1818class Player;
     19class SpriteParticles;
    1920
    2021//! Basic controllable WorldEntity
     
    5455    /** @return a List of Events in PEV_* sytle */
    5556    inline const std::list<int>& getEventList() { return this->events; };
    56    
     57
    5758    int       writeSync(const byte* data, int length, int sender);
    5859    int       readSync(byte* data, int maxLength );
     
    7475    int                   oldFlags;           //!< Used for synchronisation
    7576
     77    //HACK: explosion emitter
     78    DotEmitter*           emitter;
     79    SpriteParticles*      explosionParticles;
    7680};
    7781
Note: See TracChangeset for help on using the changeset viewer.