Changeset 11986
- Timestamp:
- May 24, 2018, 3:03:31 PM (7 years ago)
- Location:
- code/branches/RacingBots_FS18/src/modules/gametypes
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/RacingBots_FS18/src/modules/gametypes/SpaceRace.cc
r11982 r11986 142 142 } 143 143 144 std::string message("Use headphones to hear the countdown! Press W for forward acceleration, W+space barfor boost!");144 std::string message("Use headphones to hear the countdown! Press W for forward acceleration, press W+space for boost!"); 145 145 146 146 this->getGametypeInfo()->sendAnnounceMessage(message); … … 191 191 int ms = static_cast<int>(this->clock_.getMilliseconds() - 1000*s); 192 192 std::string message; 193 message = multi_cast<std::string>(s)+"You could not reach the last checkpoint before your opponents. YOU LOOSE!";194 195 193 if (this->bTimeIsUp_) 196 194 { … … 198 196 + "You loose!"; 199 197 } 198 else if(this->bLost){ 199 message = multi_cast<std::string>(s)+"You could not reach the last checkpoint before your opponents. YOU LOOSE!"; 200 201 } 200 202 201 203 else … … 207 209 if (!this->hasEnded()) 208 210 { 211 209 212 this->getGametypeInfo()->sendAnnounceMessage(message); 210 213 ChatManager::message(message); … … 222 225 223 226 224 225 const std::string& message = player->getName() + " reached the checkpoint " + multi_cast<std::string>(checkpoint->getCheckpointIndex() + 1) 227 std::string message(player->getName() + " reached the checkpoint " + multi_cast<std::string>(checkpoint->getCheckpointIndex() + 1) 228 + " after " + multi_cast<std::string>(s) + "." + multi_cast<std::string>(ms) + " seconds."); 229 230 this->getGametypeInfo()->sendAnnounceMessage(message); 231 ChatManager::message(message); 232 /* const std::string& message = player->getName() + " reached the checkpoint " + multi_cast<std::string>(checkpoint->getCheckpointIndex() + 1) 226 233 + "after " + multi_cast<std::string>(s) + "." + multi_cast<std::string>(ms) + " seconds."; 227 234 this->getGametypeInfo()->sendAnnounceMessage(message); 228 ChatManager::message(message); 229 if(checkpoint->getCheckpointIndex()== 20){235 ChatManager::message(message);*/ 236 if(checkpoint->getCheckpointIndex()==19){ 230 237 const std::string& message = player->getName() + " reached the checkpoint " + multi_cast<std::string>(checkpoint->getCheckpointIndex() + 1) 231 238 + "after " + multi_cast<std::string>(s) + "." + multi_cast<std::string>(ms) + " seconds and WON THE GAME."; -
code/branches/RacingBots_FS18/src/modules/gametypes/SpaceRace.h
r11967 r11986 41 41 42 42 #include "SpaceRaceManager.h" 43 43 44 44 45 namespace orxonox … … 88 89 virtual bool allowPawnDeath(Pawn* victim, Pawn* originator) override; 89 90 bool countdown_mode = false; 90 float time_passed = 4.0f;91 float time_passed = 11.0f; 91 92 92 93 bool bLost=false; -
code/branches/RacingBots_FS18/src/modules/gametypes/SpaceRaceController.cc
r11982 r11986 107 107 return returnVec; 108 108 } 109 /*void SpaceRaceController::endtheGame() const {109 void SpaceRaceController::endtheGame() const { 110 110 SpaceRace* gametype = orxonox_cast<SpaceRace*>(this->getGametype()); 111 assert(gametype) ;112 if (!gametype)111 assert(gametype) 112 ; if (!gametype) 113 113 return; 114 gametype->bLost=true; 114 115 gametype->end(); 115 116 116 } */117 } 117 118 /* 118 119 * called from 'findStaticCheckpoints' … … 176 177 { 177 178 RaceCheckPoint* nextRaceCheckPoint = findCheckpoint(checkpointIndex); 179 178 180 float distance = recCalculateDistance(nextRaceCheckPoint, this->getControllableEntity()->getPosition()); 179 181 … … 184 186 185 187 } 186 187 } 188 if(minNextRaceCheckPoint == nullptr) { orxout()<<"nullptr found @181 SpaceRaceController" << endl;} 188 //There is a bug. If the user passes through the 19th checkpoint with the opponents, the game will end immediately 189 if(nextRaceCheckPoint->isLast()) 190 endtheGame(); 191 192 } 193 if(minNextRaceCheckPoint == nullptr) { orxout()<<"nullptr found @192 SpaceRaceController" << endl;} 189 194 return minNextRaceCheckPoint; 190 195 } -
code/branches/RacingBots_FS18/src/modules/gametypes/SpaceRaceController.h
r11982 r11986 58 58 RaceCheckPoint* nextPointFind(RaceCheckPoint*); 59 59 RaceCheckPoint* adjustNextPoint(); 60 //void endtheGame() const;60 void endtheGame() const; 61 61 62 62 std::vector<RaceCheckPoint*> findStaticCheckpoints(RaceCheckPoint*, const std::vector<RaceCheckPoint*>&);
Note: See TracChangeset
for help on using the changeset viewer.