- Timestamp:
- Nov 12, 2014, 3:58:59 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/surfaceraceHS14/src/modules/dodgerace2/DodgeRace.cc
r10117 r10118 33 33 34 34 #include "DodgeRace.h" 35 36 #include "core/CoreIncludes.h" 37 #include "core/EventIncludes.h" 38 #include "core/command/Executor.h" 39 #include "core/config/ConfigValueIncludes.h" 40 41 #include "gamestates/GSLevel.h" 42 #include "chat/ChatManager.h" 43 44 // ! HACK 45 #include "infos/PlayerInfo.h" 46 47 /*#include "DodgeRaceCenterPoint.h" 48 #include "DodgeRaceShip.h" 49 #include "DodgeRaceEnemy.h" 50 #include "DodgeRaceEnemyShooter.h" 51 */ 52 #include "core/command/ConsoleCommand.h" 53 #include "worldentities/BigExplosion.h" 35 #include "DodgeRaceShip.h" // Necessary for getPlayer function. Do NOT include this in Header! 54 36 55 37 namespace orxonox 56 38 { 57 Register Class(DodgeRace);39 RegisterUnloadableClass(DodgeRace); 58 40 59 41 DodgeRace::DodgeRace(Context* context) : Deathmatch(context) 60 42 { 61 43 RegisterObject(DodgeRace); 44 init(); 62 45 this->numberOfBots_ = 0; //sets number of default bots temporarly to 0 63 this->center_ = NULL;64 init();65 this->setHUDTemplate("DodgeRaceHUD"); // !!!!!!!!!!!!!!! change later 46 this->center_ = 0; 47 /* 48 this->setHUDTemplate("DodgeRaceHUD"); // !!!!!!!!!!!!!!! change later*/ 66 49 } 67 50 … … 75 58 multiplier = 1; 76 59 b_combo = false; 60 77 61 // spawn enemy every 3.5 seconds 78 62 //enemySpawnTimer.setTimer(3.5f, true, createExecutor(createFunctor(&DodgeRace::spawnEnemy, this))); 79 //comboTimer.setTimer(3.0f, true, createExecutor(createFunctor(&DodgeRace::comboControll, this)));63 comboTimer.setTimer(3.0f, true, createExecutor(createFunctor(&DodgeRace::comboControll, this))); 80 64 } 81 65 … … 83 67 { 84 68 level++; 85 if (getPlayer() != NULL)69 /* if (getPlayer() != NULL) 86 70 { 87 71 for (int i = 0; i < 7; i++) … … 92 76 chunk->setScale(20); 93 77 } 94 } 78 }*/ 95 79 addPoints(multiplier * 42); 96 80 multiplier *= 2; … … 110 94 return player; 111 95 } 112 113 /*void DodgeRace::spawnEnemy()96 /* 97 void DodgeRace::spawnEnemy() 114 98 { 115 99 if (getPlayer() == NULL) … … 134 118 newPawn->setPosition(player->getPosition() + Vector3(500.f + 100 * i, 0, float(rand())/RAND_MAX * 400 - 200)); 135 119 } 136 } */120 } 137 121 138 122 void DodgeRace::costLife() … … 144 128 // enemySpawnTimer.setTimer(30.0f, false, createExecutor(createFunctor(&DodgeRace::end, this))); 145 129 }; 146 130 */ 147 131 void DodgeRace::comboControll() 148 132 { … … 161 145 this->bForceSpawn_ = true; 162 146 163 if (this->center_ == NULL) // abandon mission!147 /*if (this->center_ == NULL) // abandon mission! 164 148 { 165 149 orxout(internal_error) << "DodgeRace: No Centerpoint specified." << endl; 166 150 GSLevel::startMainMenu(); 167 151 return; 168 } 152 }*/ 169 153 // Call start for the parent class. 170 154 Deathmatch::start(); … … 178 162 } 179 163 } 180 164 /* 181 165 void DodgeRace::end() 182 166 { … … 186 170 // Instead startMainMenu, this won't crash. 187 171 GSLevel::startMainMenu(); 188 } 172 }*/ 189 173 }
Note: See TracChangeset
for help on using the changeset viewer.