Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 26, 2006, 1:55:40 AM (18 years ago)
Author:
bensch
Message:

trunk: Burst Particles

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/space_ships/space_ship.cc

    r6753 r6756  
    2727#include "weapons/turret.h"
    2828#include "weapons/cannon.h"
     29
     30#include "particle_emitter.h"
     31#include "sprite_particles.h"
    2932
    3033#include "factory.h"
     
    210213
    211214  dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( false);
     215
     216  this->burstEmitter = new ParticleEmitter(Vector(-1,0,0), 1, 200, 0.0);
     217  this->burstEmitter->setParent(this);
     218  this->burstEmitter->setName("SpaceShip_Burst_emitter");
     219
     220
     221  this->burstSystem = new SpriteParticles(1000);
     222  this->burstSystem->addEmitter(this->burstEmitter);
     223  this->burstSystem->setName("SpaceShip_Burst_System");
     224  ((SpriteParticles*)this->burstSystem)->setMaterialTexture("maps/radial-trans-noise.png");
     225  this->burstSystem->setLifeSpan(1.0, .3);
     226  this->burstSystem->setRadius(0.0, 2.0);
     227  this->burstSystem->setRadius(0.05, 3.0);
     228  this->burstSystem->setRadius(.5, .8);
     229  this->burstSystem->setRadius(1.0, .8);
     230  this->burstSystem->setColor(0.0, 1,0,0,.7);
     231  this->burstSystem->setColor(0.2, .8,.8,0,.5);
     232  this->burstSystem->setColor(0.5, .8,.8,.8,.8);
     233  this->burstSystem->setColor(1.0, .8,.8,.8,.0);
     234
    212235}
    213236
     
    219242void SpaceShip::loadParams(const TiXmlElement* root)
    220243{
    221   WorldEntity::loadParams(root);
     244  Playable::loadParams(root);
    222245}
    223246
     
    315338  velocity += ((this->getAbsDirX())*travelSpeed-velocity)*airViscosity;
    316339  velocity = (velocity.getNormalized())*travelSpeed;
     340  this->burstEmitter->setEmissionRate(travelSpeed);
    317341
    318342  //orient the spaceship in direction of the mouse
Note: See TracChangeset for help on using the changeset viewer.