Changeset 10064 in orxonox.OLD for branches/playability/src/world_entities/projectiles
- Timestamp:
- Dec 13, 2006, 3:19:40 PM (18 years ago)
- Location:
- branches/playability/src/world_entities/projectiles
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/playability/src/world_entities/projectiles/mbolt.cc
r10042 r10064 24 24 25 25 #include "particles/dot_emitter.h" 26 #include "particles/box_emitter.h" 26 27 #include "particles/sprite_particles.h" 28 29 #include "space_ships/space_ship.h" 27 30 28 31 #include <cassert> … … 33 36 34 37 #include "class_id_DEPRECATED.h" 38 ObjectListDefinition(MBolt); 35 39 CREATE_FAST_FACTORY_STATIC(MBolt); 36 40 … … 40 44 MBolt::MBolt () : Projectile() 41 45 { 42 46 this->registerObject(this, MBolt::_objectList); 43 47 this->loadModel("models/projectiles/mbolt.obj",0.25); 44 48 //this->loadModel("models/projectiles/laser.obj"); … … 49 53 this->angle = 0; 50 54 51 this->emitter = new DotEmitter(40, 0, M_2_PI); 55 56 //this->emitter = new DotEmitter(1000, 0, 0); 57 this->emitter = new BoxEmitter(Vector(8,1,1)*dynamic_cast<StaticModel*>(this->getModel())->getScaleFactor(), 1000, 0, 0); 52 58 this->emitter->setParent(this); 53 this->emitter->setSpread(M_PI, M_PI); 54 this->emitter->setEmissionRate(300.0); 55 this->emitter->setEmissionVelocity(50.0); 59 this->emitter->setSpread(M_PI,M_PI); 60 this->emitter->setInheritSpeed(this->velocity.len()); 61 this->emitter->setEmissionRate(500.0); 62 this->emitter->setEmissionVelocity(this->velocity.len()); 56 63 57 64 this->mat = new Material("mBolt"); … … 59 66 this->mat->setBlendFunc(GL_SRC_ALPHA,GL_ONE); 60 67 this->mat->setDiffuse(1,1,1); 61 this->mat->setDiffuseMap("laser .png");68 this->mat->setDiffuseMap("laser_add.png"); 62 69 this->mat->setDiffuseMap("laser.png",1); 70 63 71 dynamic_cast<StaticModel*>(this->getModel())->addMaterial(this->mat); 64 72 dynamic_cast<StaticModel*>(this->getModel())->finalize(); … … 99 107 MBolt::trailParticles->setName("BoomerangProjectileTrailParticles"); 100 108 MBolt::trailParticles->setMaterialTexture("maps/radial-trans-noise.png"); 101 MBolt::trailParticles->setLifeSpan( 1, 0);102 MBolt::trailParticles->setRadius(0.0, 1);103 MBolt::trailParticles->setRadius(1.0, 1);109 MBolt::trailParticles->setLifeSpan(0.3, 0); 110 MBolt::trailParticles->setRadius(0.0, .8); 111 MBolt::trailParticles->setRadius(1.0, .2); 104 112 MBolt::trailParticles->setColor(0.0, 1,0,0,.9); 105 113 MBolt::trailParticles->setColor(0.2, .8,.2,0,.9); 106 MBolt::trailParticles->setColor(0.5, .8,.4, 0,.8);107 MBolt::trailParticles->setColor(1.0, .8,.8, 0,.7);114 MBolt::trailParticles->setColor(0.5, .8,.4,.4,.8); 115 MBolt::trailParticles->setColor(1.0, .8,.8,.8,.7); 108 116 } 109 117 if (unlikely(MBolt::explosionParticles == NULL)) … … 125 133 this->emitter->setSystem(MBolt::trailParticles); 126 134 135 this->emitter->setSpread(0); 136 this->emitter->setEmissionRate(80.0); 137 this->emitter->setEmissionVelocity(0); 127 138 this->updateNode(0); 128 this->emitter->setSpread(0);129 this->emitter->setEmissionRate(20.0);130 this->emitter->setEmissionVelocity(this->velocity.len());131 139 } 132 140 … … 152 160 this->destroy( entity ); 153 161 this->hitEntity = entity; 162 dynamic_cast<SpaceShip*>(entity)->damage(this->getDamage(),0); 154 163 } 155 164 -
branches/playability/src/world_entities/projectiles/mbolt.h
r10042 r10064 18 18 class MBolt : public Projectile 19 19 { 20 //ObjectListDeclaration(MBolt);20 ObjectListDeclaration(MBolt); 21 21 public: 22 22 MBolt (); … … 41 41 42 42 float angle; 43 static const float rotationSpeed = 540;43 static const float rotationSpeed = 1080; 44 44 45 45 ParticleEmitter* emitter; -
branches/playability/src/world_entities/projectiles/swarm_projectile.cc
r10039 r10064 23 23 #include "particles/dot_emitter.h" 24 24 #include "particles/sprite_particles.h" 25 #include "space_ships/space_ship.h" 25 26 26 27 #include "debug.h" … … 44 45 this->setMinEnergy(1); 45 46 this->setHealthMax(10); 46 this->lifeSpan = 2.0;47 this->lifeSpan = 4.0; 47 48 this->agility = 3.5; 48 49 this->maxVelocity = 100; … … 64 65 SwarmProjectile::~SwarmProjectile () 65 66 { 66 // delete this->emitter; 67 67 68 68 69 /* this is normaly done by World.cc by deleting the ParticleEngine */ … … 79 80 SwarmProjectile::explosionParticles = NULL; 80 81 } 81 82 delete this->emitter; 82 83 } 83 84 … … 96 97 SwarmProjectile::trailParticles->setLifeSpan(1.0, .3); 97 98 SwarmProjectile::trailParticles->setRadius(0.0, .5); 98 SwarmProjectile::trailParticles->setRadius(0.2, 4.0);99 SwarmProjectile::trailParticles->setRadius(.5, 1. 5);100 SwarmProjectile::trailParticles->setRadius(1.0, 1.5);99 SwarmProjectile::trailParticles->setRadius(0.2, 2.0); 100 SwarmProjectile::trailParticles->setRadius(.5, 1.0); 101 SwarmProjectile::trailParticles->setRadius(1.0, 0.6); 101 102 SwarmProjectile::trailParticles->setColor(0.0, 1,0,0,.7); 102 103 SwarmProjectile::trailParticles->setColor(0.2, .8,.8,0,.5); … … 145 146 this->destroy( entity ); 146 147 this->hitEntity = entity; 148 dynamic_cast<SpaceShip*>(entity)->damage(this->getDamage(),0); 147 149 } 148 150
Note: See TracChangeset
for help on using the changeset viewer.