Changeset 9879 for code/branches/invaders/src
- Timestamp:
- Dec 9, 2013, 2:08:26 PM (11 years ago)
- Location:
- code/branches/invaders/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/invaders/src/modules/invader/Invader.cc
r9874 r9879 69 69 bEndGame = false; 70 70 lives = 3; 71 // TODO:72 71 level = 1; 73 72 point = 0; … … 114 113 return; 115 114 srand(player->getPosition().x + player->getPosition().y); 116 for (int i = 0; i < (3*log (level) + 1); i++)115 for (int i = 0; i < (3*log10(level) + 1); i++) 117 116 { 118 117 WeakPtr<InvaderEnemy> newPawn; -
code/branches/invaders/src/modules/invader/InvaderWeaponEnemy.cc
r9874 r9879 48 48 // SUPER(InvaderWeaponEnemy, shot); 49 49 // only shoot in foreward direction 50 projectile->setVelocity(Vector3(1, 0, 0) * -500);50 projectile->setVelocity(Vector3(1, 0, 0) * 300); 51 51 // projectile->setOrientation(Quaternion(sqrt(0.5),0,sqrt(0.5),0)); 52 52 } -
code/branches/invaders/src/orxonox/worldentities/BigExplosion.cc
r9869 r9879 78 78 } 79 79 80 BigExplosion::BigExplosion(Context* context, Vector3 initVelocity) : MobileEntity(context) 81 { 82 RegisterObject(BigExplosion); 83 this->setVelocity(initVelocity); 84 85 if ( GameMode::showsGraphics() && ( !this->getScene() || !this->getScene()->getSceneManager() ) ) 86 ThrowException(AbortLoading, "Can't create BigExplosion, no scene or no scene manager given."); 87 88 this->bStop_ = false; 89 this->LOD_ = LODParticle::Normal; 90 91 if ( GameMode::showsGraphics() ) 92 { 93 try 94 { 95 this->init(); 96 } 97 catch (const std::exception& ex) 98 { 99 orxout(internal_error) << "Couldn't load particle effect in BigExplosion: " << ex.what() << endl; 100 this->initZero(); 101 } 102 } 103 else 104 { 105 this->initZero(); 106 } 107 108 if (GameMode::isMaster()) 109 { 110 this->destroyTimer_.setTimer(rnd(2, 4), false, createExecutor(createFunctor(&BigExplosion::stop, this))); 111 } 112 113 this->registerVariables(); 114 } 115 80 116 void BigExplosion::init() 81 117 { … … 152 188 // 153 189 ParticleSpawner* effect = new ParticleSpawner(this->getContext()); 154 // orxout() << "vel " <<getVelocity() << endl;155 // effect->setVelocity( Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1))*rnd(10, 200));190 orxout() << "vel " << this->getVelocity() << endl; 191 // effect->setVelocity(this->getVelocity()); 156 192 effect->setDestroyAfterLife(true); 157 193 effect->setSource("Orxonox/explosion2b"); -
code/branches/invaders/src/orxonox/worldentities/BigExplosion.h
r9837 r9879 41 41 public: 42 42 BigExplosion(Context* context); 43 BigExplosion(Context* context, Vector3 initVelocity); 43 44 virtual ~BigExplosion(); 44 45 -
code/branches/invaders/src/orxonox/worldentities/pawns/Pawn.cc
r9837 r9879 365 365 this->setDestroyWhenPlayerLeft(false); 366 366 367 BigExplosion* chunk = new BigExplosion(this->getContext()); 367 orxout() << "big explosion: " << this->getVelocity() << endl; 368 BigExplosion* chunk = new BigExplosion(this->getContext(), this->getVelocity()); 368 369 chunk->setPosition(this->getPosition()); 369 chunk->setVelocity(this->getVelocity());370 // chunk->setVelocity(this->getVelocity()); 370 371 371 372 } … … 377 378 effect->setPosition(this->getPosition()); 378 379 effect->setOrientation(this->getOrientation()); 380 effect->setVelocity(this->getVelocity()); 379 381 effect->setDestroyAfterLife(true); 380 382 effect->setSource("Orxonox/explosion2b"); … … 385 387 effect->setPosition(this->getPosition()); 386 388 effect->setOrientation(this->getOrientation()); 389 effect->setVelocity(this->getVelocity()); 387 390 effect->setDestroyAfterLife(true); 388 391 effect->setSource("Orxonox/smoke6"); … … 393 396 effect->setPosition(this->getPosition()); 394 397 effect->setOrientation(this->getOrientation()); 398 effect->setVelocity(this->getVelocity()); 395 399 effect->setDestroyAfterLife(true); 396 400 effect->setSource("Orxonox/sparks");
Note: See TracChangeset
for help on using the changeset viewer.