Changeset 11837 for code/branches/OrxyRoad_FS18/src/modules/orxyroad
- Timestamp:
- Mar 29, 2018, 3:26:21 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/OrxyRoad_FS18/src/modules/orxyroad/OrxyRoad.cc
r11836 r11837 28 28 29 29 /** 30 @file DodgeRace.cc31 @brief Implementation of the DodgeRaceclass.30 @file OrxyRoad.cc 31 @brief Implementation of the OrxyRoad class. 32 32 */ 33 33 34 #include " DodgeRace.h"35 #include " DodgeRaceShip.h" // Necessary for getPlayer function. Do NOT include this in Header!36 #include " DodgeRaceCube.h"34 #include "OrxyRoad.h" 35 #include "OrxyRoadShip.h" // Necessary for getPlayer function. Do NOT include this in Header! 36 #include "OrxyRoadCube.h" 37 37 #include "core/CoreIncludes.h" 38 38 #include "Highscore.h" … … 41 41 namespace orxonox 42 42 { 43 RegisterUnloadableClass( DodgeRace);44 45 DodgeRace::DodgeRace(Context* context) : Deathmatch(context)46 { 47 RegisterObject( DodgeRace);43 RegisterUnloadableClass(OrxyRoad); 44 45 OrxyRoad::OrxyRoad(Context* context) : Deathmatch(context) 46 { 47 RegisterObject(OrxyRoad); 48 48 49 49 bEndGame = false; … … 58 58 lastPosition = 0; 59 59 // spawn enemy every 3.5 seconds 60 //enemySpawnTimer.setTimer(3.5f, true, createExecutor(createFunctor(& DodgeRace::spawnEnemy, this)));61 comboTimer.setTimer(3.0f, true, createExecutor(createFunctor(& DodgeRace::comboControll, this)));60 //enemySpawnTimer.setTimer(3.5f, true, createExecutor(createFunctor(&OrxyRoad::spawnEnemy, this))); 61 comboTimer.setTimer(3.0f, true, createExecutor(createFunctor(&OrxyRoad::comboControll, this))); 62 62 this->numberOfBots_ = 0; //sets number of default bots temporarly to 0 63 63 this->center_ = nullptr; 64 64 65 this->setHUDTemplate(" DodgeRaceHUD");66 } 67 68 void DodgeRace::levelUp()65 this->setHUDTemplate("OrxyRoadHUD"); 66 } 67 68 void OrxyRoad::levelUp() 69 69 { 70 70 level++; … … 86 86 multiplier *= 2; 87 87 toggleShowLevel(); 88 showLevelTimer.setTimer(1.0f, false, createExecutor(createFunctor(& DodgeRace::toggleShowLevel, this)));89 } 90 91 void DodgeRace::tick(float dt)92 { 93 DodgeRaceShip* player = this->getPlayer();88 showLevelTimer.setTimer(1.0f, false, createExecutor(createFunctor(&OrxyRoad::toggleShowLevel, this))); 89 } 90 91 void OrxyRoad::tick(float dt) 92 { 93 OrxyRoadShip* player = this->getPlayer(); 94 94 if (player != nullptr) 95 95 { … … 114 114 for(int i = 0; i<6; i++) 115 115 { 116 DodgeRaceCube* cube = new DodgeRaceCube(this->center_->getContext());116 OrxyRoadCube* cube = new OrxyRoadCube(this->center_->getContext()); 117 117 cubeList.push_back(cube); 118 118 switch(pattern) 119 119 { 120 case 1: cube->addTemplate(" DodgeRaceCube01");120 case 1: cube->addTemplate("OrxyRoadCube01"); 121 121 break; 122 case 2: cube->addTemplate(" DodgeRaceCube02");122 case 2: cube->addTemplate("OrxyRoadCube02"); 123 123 break; 124 124 … … 136 136 137 137 } 138 SUPER( DodgeRace, tick, dt);139 } 140 141 DodgeRaceShip* DodgeRace::getPlayer()142 { 143 for ( DodgeRaceShip* ship : ObjectList<DodgeRaceShip>())138 SUPER(OrxyRoad, tick, dt); 139 } 140 141 OrxyRoadShip* OrxyRoad::getPlayer() 142 { 143 for (OrxyRoadShip* ship : ObjectList<OrxyRoadShip>()) 144 144 { 145 145 return ship; … … 148 148 } 149 149 150 void DodgeRace::costLife()151 { 152 //endGameTimer.setTimer(8.0f, false, createExecutor(createFunctor(& DodgeRace::end, this)));150 void OrxyRoad::costLife() 151 { 152 //endGameTimer.setTimer(8.0f, false, createExecutor(createFunctor(&OrxyRoad::end, this))); 153 153 lives = 0; 154 154 }; 155 155 156 void DodgeRace::comboControll()156 void OrxyRoad::comboControll() 157 157 { 158 158 if (b_combo) … … 164 164 } 165 165 166 void DodgeRace::start()166 void OrxyRoad::start() 167 167 { 168 168 orxout() << "start" << endl; … … 179 179 if (this->center_ == nullptr) // abandon mission! 180 180 { 181 orxout(internal_error) << " DodgeRace: No Centerpoint specified." << endl;181 orxout(internal_error) << "OrxyRoad: No Centerpoint specified." << endl; 182 182 GSLevel::startMainMenu(); 183 183 return; … … 187 187 } 188 188 189 void DodgeRace::playerPreSpawn(PlayerInfo* player)189 void OrxyRoad::playerPreSpawn(PlayerInfo* player) 190 190 { 191 191 this->playerInfo_ = player; … … 210 210 } 211 211 212 void DodgeRace::addPoints(int numPoints)212 void OrxyRoad::addPoints(int numPoints) 213 213 { 214 214 if (!bEndGame) … … 219 219 } 220 220 221 void DodgeRace::end()221 void OrxyRoad::end() 222 222 { 223 223 // DON'T CALL THIS!
Note: See TracChangeset
for help on using the changeset viewer.