- Timestamp:
- Feb 3, 2006, 2:18:26 AM (19 years ago)
- Location:
- trunk/src/world_entities/space_ships
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/space_ships/space_ship.cc
r6997 r7001 287 287 Playable::collidesWith(entity, location); 288 288 289 290 if (entity->isA(CL_TURRET_POWER_UP) && entity != ref)291 {292 this->ADDWEAPON();293 ref = entity;294 }295 296 289 if( entity->isA(CL_PROJECTILE) && entity != ref) 297 290 { … … 501 494 } 502 495 503 #include "weapons/aiming_turret.h"504 // FIXME THIS MIGHT BE CONSIDERED EITHER A FEATURE, OR A BUG505 void SpaceShip::ADDWEAPON()506 {507 Weapon* turret = NULL;508 509 if ((float)rand()/RAND_MAX < .9)510 {511 //if (this->getWeaponManager()->hasFreeSlot(2, WTYPE_TURRET))512 {513 turret = new Turret();514 this->addWeapon(turret, 2);515 this->getWeaponManager()->changeWeaponConfig(2);516 }517 }518 else519 {520 //if (this->getWeaponManager()->hasFreeSlot(3))521 {522 turret = dynamic_cast<Weapon*>(Factory::fabricate(CL_TARGETING_TURRET));523 if (turret != NULL)524 this->addWeapon(turret, 3);525 526 this->getWeaponManager()->changeWeaponConfig(3);527 }528 }529 530 if(turret != NULL)531 {532 turret->setName("Turret");533 turret->setStateDuration(WS_SHOOTING, (float)rand()/RAND_MAX*.5+.1);534 }535 }536 496 537 497 #define MASK_bUp 1 -
trunk/src/world_entities/space_ships/space_ship.h
r6959 r7001 49 49 void doCollideNetwork( float energy ); 50 50 51 // !! temporary !!52 void ADDWEAPON();53 54 51 bool bUp; //!< up button pressed. 55 52 bool bDown; //!< down button pressed. -
trunk/src/world_entities/space_ships/turbine_hover.cc
r7000 r7001 30 30 31 31 #include "graphics_engine.h" 32 #include "dot_emitter.h" 33 #include "sprite_particles.h" 32 34 33 35 using namespace std; … … 112 114 this->cameraLook = 0.0f; 113 115 this->rotation = 0.0f; 114 this->acceleration = 25.0f;115 this->airFriction = 3.0f;116 this->acceleration = 10.0f; 117 this->airFriction = 2.0f; 116 118 117 119 // camera - issue … … 138 140 this->rotorNodeRight.setRelCoor(0, 1.0, 2.3); 139 141 140 dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( false); 142 // PARTICLES 143 this->burstEmitter[0] = new DotEmitter(200, 5.0, .01); 144 this->burstEmitter[0]->setParent(&this->rotorNodeLeft); 145 this->burstEmitter[0]->setRelCoor(0, -0.7, 0); 146 this->burstEmitter[0]->setRelDir(Quaternion(-M_PI_2, Vector(0,0,1))); 147 this->burstEmitter[0]->setName("TurbineHover_Burst_emitter_Left"); 148 149 this->burstEmitter[1] = new DotEmitter(200, 5.0, .01); 150 this->burstEmitter[1]->setParent(&this->rotorNodeRight); 151 this->burstEmitter[1]->setRelCoor(0, -0.7, 0); 152 this->burstEmitter[1]->setRelDir(Quaternion(-M_PI_2, Vector(0,0,1))); 153 this->burstEmitter[1]->setName("TurbineHover_Burst_emitter_Right"); 154 155 156 this->burstSystem = new SpriteParticles(1000); 157 this->burstSystem->addEmitter(this->burstEmitter[0]); 158 this->burstSystem->addEmitter(this->burstEmitter[1]); 159 this->burstSystem->setName("SpaceShip_Burst_System"); 160 ((SpriteParticles*)this->burstSystem)->setMaterialTexture("maps/radial-trans-noise.png"); 161 this->burstSystem->setLifeSpan(1.0, .3); 162 this->burstSystem->setRadius(0.0, 1.5); 163 this->burstSystem->setRadius(0.05, 1.8); 164 this->burstSystem->setRadius(.5, .8); 165 this->burstSystem->setRadius(1.0, 0); 166 this->burstSystem->setColor(0.0, .7,.7,1,.5); 167 this->burstSystem->setColor(0.2, 0,0,0.8,.5); 168 this->burstSystem->setColor(0.5, .5,.5,.8,.3); 169 this->burstSystem->setColor(1.0, .8,.8,.8,.0); 141 170 142 171 … … 153 182 registerEvent(EV_MOUSE_MOTION); 154 183 184 dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( false); 155 185 156 186 // WEAPON_MANAGER configuration … … 241 271 this->movement(dt); 242 272 this->rotorCycle += this->rotorSpeed * dt; 273 274 // TRYING TO FIX PNode. 275 /* this->cameraNode.setAbsCoorSoft(this->getAbsCoor() + Vector(0,5,0), 30); 276 this->cameraNode.setAbsDirSoft(this->getAbsDir(), 30);*/ 243 277 } 244 278 … … 293 327 this->setRelDirSoft(this->direction * Quaternion(-cameraLook, Vector(0,0,1)), 5); 294 328 295 this->wingNodeLeft.setRelDirSoft(Quaternion(accel.z * .0 3+this->rotation, Vector(1,0,0)), 5);296 this->rotorNodeLeft.setRelDirSoft(Quaternion(-accel.x * .0 5+this->rotation + cameraLook, Vector(0,0,1)), 5);297 298 this->wingNodeRight.setRelDirSoft(Quaternion(accel.z * .0 3+this->rotation, Vector(1,0,0)), 5);299 this->rotorNodeRight.setRelDirSoft(Quaternion(-accel.x*.0 5-this->rotation + cameraLook, Vector(0,0,1)), 5);329 this->wingNodeLeft.setRelDirSoft(Quaternion(accel.z * .05 +this->rotation, Vector(1,0,0)), 5); 330 this->rotorNodeLeft.setRelDirSoft(Quaternion(-accel.x * .07+this->rotation + cameraLook, Vector(0,0,1)), 5); 331 332 this->wingNodeRight.setRelDirSoft(Quaternion(accel.z * .05 +this->rotation, Vector(1,0,0)), 5); 333 this->rotorNodeRight.setRelDirSoft(Quaternion(-accel.x*.07 -this->rotation + cameraLook, Vector(0,0,1)), 5); 300 334 } 301 335 -
trunk/src/world_entities/space_ships/turbine_hover.h
r7000 r7001 9 9 10 10 #include "playable.h" 11 12 // Forward Declaration 13 class ParticleEmitter; 14 class ParticleSystem; 11 15 12 16 class TurbineHover : public Playable … … 67 71 float airViscosity; 68 72 73 ParticleEmitter* burstEmitter[2]; 74 ParticleSystem* burstSystem; 69 75 }; 70 76
Note: See TracChangeset
for help on using the changeset viewer.