[Orxonox-commit 7349] r11966 - code/branches/RacingBots_FS18/src/modules/gametypes
andera at orxonox.net
andera at orxonox.net
Thu May 17 14:30:20 CEST 2018
Author: andera
Date: 2018-05-17 14:30:20 +0200 (Thu, 17 May 2018)
New Revision: 11966
Modified:
code/branches/RacingBots_FS18/src/modules/gametypes/SpaceRace.cc
Log:
SpaceRaceController.cc updated
Modified: code/branches/RacingBots_FS18/src/modules/gametypes/SpaceRace.cc
===================================================================
--- code/branches/RacingBots_FS18/src/modules/gametypes/SpaceRace.cc 2018-05-17 12:29:38 UTC (rev 11965)
+++ code/branches/RacingBots_FS18/src/modules/gametypes/SpaceRace.cc 2018-05-17 12:30:20 UTC (rev 11966)
@@ -84,8 +84,8 @@
this->botclass_ = Class(SpaceRaceBot);
this->cantMove_ = false;
this->bTimeIsUp_ = false;
-
this->numberOfBots_ = 5; // quick fix: don't allow default-bots to enter the race
+ this->bLost =false;
//we fixed the number of bots in order to have the same starting position all the time !
}
@@ -124,12 +124,9 @@
for (Engine* engine : ObjectList<Engine>())
{
engine->setActive(false);
- engine->addSpeedMultiply(1.7);
-
-
+ engine->setAccelerationFront(100.0f);
}
-
//append spawn positions to bots
int a,b,c;
a=0;
@@ -196,8 +193,10 @@
if (this->bTimeIsUp_)
{
message = multi_cast<std::string>(s) + "." + multi_cast<std::string>(ms) + " seconds !!\n"
- + "You lose!";
+ + "You loose!";
}
+ else if(this->bLost)
+ message = multi_cast<std::string>(s)+"You could not reach the last checkpoint before your opponents. YOU LOOSE!";
else
{
message = "You win!! Final check point reached after "+ multi_cast<std::string>(s)
@@ -225,7 +224,12 @@
+ "after " + multi_cast<std::string>(s) + "." + multi_cast<std::string>(ms) + " seconds.";
this->getGametypeInfo()->sendAnnounceMessage(message);
ChatManager::message(message);
+ if(checkpoint->getCheckpointIndex()==20){
+ const std::string& message = player->getName() + " reached the checkpoint " + multi_cast<std::string>(checkpoint->getCheckpointIndex() + 1)
+ + "after " + multi_cast<std::string>(s) + "." + multi_cast<std::string>(ms) + " seconds and WON THE GAME.";
+ }
+
}
void SpaceRace::countdownFinished()//activates the engines of all players
More information about the Orxonox-commit
mailing list