Changeset 11337 for code/branches/SpaceRace_HS16/src
- Timestamp:
- Dec 13, 2016, 5:46:18 PM (8 years ago)
- Location:
- code/branches/SpaceRace_HS16/src/modules/gametypes
- Files:
-
- 4 deleted
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/SpaceRace_HS16/src/modules/gametypes/SpaceRace.cc
r11334 r11337 23 23 * Mauro Salomon 24 24 * Co-authors: 25 * Celine Egger 25 * Celine Egger*/ 26 27 28 29 30 /* 31 Edited, Renewed and Revised by 26 32 Berkay Berabi 27 33 Louis Meile 28 * 29 */ 30 31 /* 32 Todo: 34 35 36 To-do- list by Louis Meile and Berkay Berabi for future projects : 33 37 - improve AI (SpaceRaceController): 34 38 i) so far bots arent able to evade obstacles. fix that! 35 39 ii) bots should be able to use pickups 36 - game crashes when bot wins the game 40 - game crashes when bot wins the game(this is a huge problem you should work with the log file to find out what the errors are ) 37 41 - bots rotate while waiting for the countdown to end. make it stop! 38 42 - add elements to level file to make it even more fun to play. be creative! … … 81 85 this->setConfigValues(); 82 86 83 this->numberOfBots_ = 5; // quick fix: don't allow default-bots to enter the race 87 this->numberOfBots_ = 5; // quick fix: don't allow default-bots to enter the race 88 //we fixed the number of bots in order to have the same starting position all the time ! 84 89 } 85 90 … … 90 95 } 91 96 97 void SpaceRace::start() 98 { 92 99 // define spawn positions of the 5 bots 93 void SpaceRace::start()94 {95 100 96 101 int startpos[15]; … … 124 129 this->spawnPlayersIfRequested(); 125 130 this->cantMove_ = true; 126 // botsunable to move while countdown is running131 //players are unable to move while countdown is running 127 132 for (Engine* engine : ObjectList<Engine>()){ 128 133 engine->setActive(false); … … 151 156 ChatManager::message(message); 152 157 153 //after 11 s , countdownFinishedis called to activate bots` engines158 //after 11 seconds , countdownFinished function is called to activate bots` engines 154 159 Timer* countdownTimer = new Timer(); 155 160 countdownTimer->setTimer(11, false, createExecutor(createFunctor(&SpaceRace::countdownFinished, this))); … … 207 212 } 208 213 209 void SpaceRace::countdownFinished() 214 void SpaceRace::countdownFinished()//activates the engines of all players 210 215 { 211 216 … … 231 236 232 237 233 void SpaceRace::addBots(unsigned int amount) 238 void SpaceRace::addBots(unsigned int amount) //function that add the bots to the game 234 239 { 235 240 for (unsigned int i = 1; i <= amount; ++i){ … … 250 255 } 251 256 252 bool SpaceRace::allowPawnDeath(Pawn* victim, Pawn* originator) 257 bool SpaceRace::allowPawnDeath(Pawn* victim, Pawn* originator)// false because the bots can not recognize the objects and die to early 258 //if they can 253 259 { 254 260 return false;
Note: See TracChangeset
for help on using the changeset viewer.