Changeset 10624 for code/trunk/src/modules/dodgerace/DodgeRace.cc
- Timestamp:
- Oct 4, 2015, 9:12:21 PM (9 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
-
code/trunk/src/modules/dodgerace/DodgeRace.cc
r10236 r10624 35 35 #include "DodgeRaceShip.h" // Necessary for getPlayer function. Do NOT include this in Header! 36 36 #include "DodgeRaceCube.h" 37 #include "core/CoreIncludes.h" 37 38 38 39 namespace orxonox … … 43 44 { 44 45 RegisterObject(DodgeRace); 45 init(); 46 this->numberOfBots_ = 0; //sets number of default bots temporarly to 0 47 this->center_ = 0; 48 49 this->setHUDTemplate("DodgeRaceHUD"); 50 } 51 52 void DodgeRace::init() 53 { 46 54 47 bEndGame = false; 55 48 lives = 1; … … 65 58 //enemySpawnTimer.setTimer(3.5f, true, createExecutor(createFunctor(&DodgeRace::spawnEnemy, this))); 66 59 comboTimer.setTimer(3.0f, true, createExecutor(createFunctor(&DodgeRace::comboControll, this))); 60 this->numberOfBots_ = 0; //sets number of default bots temporarly to 0 61 this->center_ = 0; 62 63 this->setHUDTemplate("DodgeRaceHUD"); 67 64 } 68 65 … … 74 71 for (int i = 0; i < 7; i++) 75 72 { 76 WeakPtr<BigExplosion>chunk = new BigExplosion(this->center_->getContext());73 BigExplosion* chunk = new BigExplosion(this->center_->getContext()); 77 74 chunk->setPosition(Vector3(600, 0, 100.f * i - 300)); 78 75 chunk->setVelocity(Vector3(1000, 0, 0)); //player->getVelocity() … … 90 87 if (getPlayer() != NULL) 91 88 { 92 //WeakPtr<DodgeRaceShip> ship = getPlayer();93 94 89 currentPosition = getPlayer()->getWorldPosition().x; 95 90 counter = counter + (currentPosition - lastPosition); … … 112 107 for(int i = 0; i<6; i++) 113 108 { 114 WeakPtr<DodgeRaceCube>cube = new DodgeRaceCube(this->center_->getContext());109 DodgeRaceCube* cube = new DodgeRaceCube(this->center_->getContext()); 115 110 cubeList.push_back(cube); 116 111 switch(pattern) … … 137 132 } 138 133 139 WeakPtr<DodgeRaceShip>DodgeRace::getPlayer()134 DodgeRaceShip* DodgeRace::getPlayer() 140 135 { 141 136 if (player == NULL) … … 168 163 { 169 164 orxout() << "start" << endl; 170 init();171 165 for(unsigned int i=0; i< cubeList.size();i++) 172 166 { … … 199 193 /* 200 194 orxout() << "prespawn" << endl; 201 init();202 195 for(int i=0; i< cubeList.size();i++) 203 196 {
Note: See TracChangeset
for help on using the changeset viewer.