Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6959 in orxonox.OLD for trunk/src/world_entities/playable.cc


Ignore:
Timestamp:
Feb 1, 2006, 4:40:34 PM (18 years ago)
Author:
patrick
Message:

trunk: merged network branche into trunk

File:
1 edited

Legend:

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

    r6871 r6959  
    2828
    2929
     30#include "dot_emitter.h"
     31#include "sprite_particles.h"
     32
     33
    3034Playable::Playable()
    3135{
     
    4347
    4448  this->setSynchronized(true);
     49
     50  this->score = 0;
     51  this->oldScore = 0;
     52
     53
     54  this->emitter = new DotEmitter(100, 5, M_2_PI);
     55  this->emitter->setParent(this);
     56  this->emitter->setSpread(M_PI, M_PI);
     57  this->emitter->setEmissionRate(300.0);
     58  this->emitter->setEmissionVelocity(50.0);
     59
     60  this->explosionParticles = new SpriteParticles(1000);
     61  this->explosionParticles->setName("LaserExplosionParticles");
     62  this->explosionParticles->setLifeSpan(.5, .3);
     63  this->explosionParticles->setRadius(0.0, 10.0);
     64  this->explosionParticles->setRadius(.5, 6.0);
     65  this->explosionParticles->setRadius(1.0, 3.0);
     66  this->explosionParticles->setColor(0.0, 1,1,0,.9);
     67  this->explosionParticles->setColor(0.5, .8,.8,0,.5);
     68  this->explosionParticles->setColor(1.0, .8,.8,.7,.0);
    4569}
    4670
     
    101125void Playable::collidesWith(WorldEntity* entity, const Vector& location)
    102126{
    103   if (entity->isA(CL_PROJECTILE))
     127  if (entity->isA(CL_PROJECTILE) && !State::isOnline() )
    104128    this->decreaseHealth(entity->getHealth());
    105129
    106130  // EXTREME HACK
    107131  if (this->getHealth() == 0.0f)
    108     this->deactivateNode();
     132  {
     133    //this->deactivateNode();
     134    this->emitter->setSystem(explosionParticles);
     135    this->setAbsCoor(0, 0, 0);
     136    //this->setAbsDir(Vector(1,0,0), 0);
     137    this->emitter->setSystem(NULL);
     138  }
    109139}
    110140
     
    248278}
    249279
     280#define DATA_FLAGS    1
     281#define DATA_SCORE    2
     282
    250283#define FLAGS_bFire   1
    251284
     
    281314bool Playable::needsReadSync( )
    282315{
     316  //if ( score != oldScore )
     317  //  return true;
     318
    283319  byte flags = 0;
    284320
Note: See TracChangeset for help on using the changeset viewer.