[Orxonox-commit 7243] r11857 - in code/branches/RacingBots_FS18: data/levels src/modules/gametypes
andera at orxonox.net
andera at orxonox.net
Thu Apr 12 16:09:58 CEST 2018
Author: andera
Date: 2018-04-12 16:09:58 +0200 (Thu, 12 Apr 2018)
New Revision: 11857
Modified:
code/branches/RacingBots_FS18/data/levels/newnewnewspacerace.oxw
code/branches/RacingBots_FS18/src/modules/gametypes/SpaceRace.cc
code/branches/RacingBots_FS18/src/modules/gametypes/SpaceRace.h
Log:
the counter in the beginning of the game has been editted. New checkpoint pointer has been added. New arrow is made in blender but not uploaded yet
Modified: code/branches/RacingBots_FS18/data/levels/newnewnewspacerace.oxw
===================================================================
--- code/branches/RacingBots_FS18/data/levels/newnewnewspacerace.oxw 2018-04-12 13:31:05 UTC (rev 11856)
+++ code/branches/RacingBots_FS18/data/levels/newnewnewspacerace.oxw 2018-04-12 14:09:58 UTC (rev 11857)
@@ -228,8 +228,11 @@
<checkpoints>
<!-- distance = how far from the middle point of a check point do i have to fly ? distance variable answers this question -->
+
+
+
<RaceCheckPoint name="checkpoint1" yaw=90 pitch=90 position="1000,30,0" roll="0" direction="0,1,0" collisionType="static" scale="1" distance="60" checkpointindex="0" islast="false" nextcheckpoints="1,-1,-1">
<attached>
<Model position="0,0,0" scale="70" mesh="Checkpoint_Green.mesh"/>
@@ -490,9 +493,42 @@
</checkpoints>
</SpaceRaceManager>
+ <Arrow>
+ <attached>
+ <Model scale="5" mesh="tutorialpointer3.mesh"/>
+ </attached>
+ <controller>
+ <ArrowController accuracy = 2000>
+ <gpspoints>
+ <Model mesh="cube.mesh" scale=1.5 position="1000,30,0"/>
+ <Model mesh="cube.mesh" scale=1.5 position="3000,200,100"/>
+ <Model mesh="cube.mesh" scale=1.5 position="5000,100,500"/>
+ <Model mesh="cube.mesh" scale=1.5 position="8000,-150,150"/>
+ <Model mesh="cube.mesh" scale=1.5 position="10000,-200,200"/>
+ <Model mesh="cube.mesh" scale=1.5 position="13000,200,400"/>
+ <Model mesh="cube.mesh" scale=1.5 position="15000,0,0"/>
+ <Model mesh="cube.mesh" scale=1.5 position="18000,150,-150"/>
+ <Model mesh="cube.mesh" scale=1.5 position="21000,200,-120"/>
+ <Model mesh="cube.mesh" scale=1.5 position="24000,-150,-80"/>
+ <Model mesh="cube.mesh" scale=1.5 position="27000,-200,0"/>
+ <Model mesh="cube.mesh" scale=1.5 position="30000,-300,900"/>
+ <Model mesh="cube.mesh" scale=1.5 position="33000,600,60"/>
+ <Model mesh="cube.mesh" scale=1.5 position="35000,120,20"/>
+ <Model mesh="cube.mesh" scale=1.5 position="38000,-200,0"/>
+ <Model mesh="cube.mesh" scale=1.5 position="41000,30,-50"/>
+ <Model mesh="cube.mesh" scale=1.5 position="44000,90,0"/>
+ <Model mesh="cube.mesh" scale=1.5 position="47000,120,30"/>
+ <Model mesh="cube.mesh" scale=1.5 position="50000,0,100"/>
+ <Model mesh="cube.mesh" scale=1.5 position="53000,0,0"/>
+
+ </gpspoints>
+ </ArrowController>
+ </controller>
+ </Arrow>
+
<!-- ---------------------PickUps---------------------- -->
<PickupSpawner pickup=smallshrinkpickup position="10000,-200,200" triggerDistance="60" respawnTime="10" maxSpawnedItems="10" scale="8"/>
Modified: code/branches/RacingBots_FS18/src/modules/gametypes/SpaceRace.cc
===================================================================
--- code/branches/RacingBots_FS18/src/modules/gametypes/SpaceRace.cc 2018-04-12 13:31:05 UTC (rev 11856)
+++ code/branches/RacingBots_FS18/src/modules/gametypes/SpaceRace.cc 2018-04-12 14:09:58 UTC (rev 11857)
@@ -118,6 +118,7 @@
Gametype::start();
this->spawnPlayersIfRequested();
+ this->countdown_mode=true;
this->cantMove_ = true;
//players are unable to move while countdown is running
for (Engine* engine : ObjectList<Engine>())
@@ -144,55 +145,26 @@
this->getGametypeInfo()->sendAnnounceMessage(message);
ChatManager::message(message);
-
- /*for(int i=10; i>0;i=i-1){
- startmessage(i);
- }*/
- //after 11 seconds , countdownFinished function is called to activate bots` engines
- //Timer* countdownTimer = new Timer();
- //countdownTimer->setTimer(11, false, createExecutor(createFunctor(&SpaceRace::countdownFinished, this)));
-
- /*
- while(countdownTimer->getRemainingTime()!=0){
- if(countdownTimer->getRemainingTime()==1){
- startmessage(1);
- }
- }*/
-
-
-
-
-
-
- /*unsigned long long float time_notification=countdownTimer.getRealMicroSeconds();
- while(this->bTimeIsUp_==false){
-
- std::ostream stream;
- stream<<time_notification;
- std::string chat_notification(stream.str());
- this->getGametypeInfo()->sendAnnounceMessage(chat_notification);
- ChatManager::message(chat_notification);
-
- }*/
-
-
}
-
-
+ // Counter in the beginning of the game
void SpaceRace::tick(float dt) {
SUPER(SpaceRace, tick, dt);
- this->time_passed -= dt;
-
+
+ //countdown_mode is set true,when spawnIfRequested is called
if (countdown_mode) {
+ //10 seconds will be counted
+ this->time_passed -= dt;
//orxout() << "time: " <<(int) time_passed << "s" << endl;
+
std::string message=std::to_string((int)time_passed);
this->getGametypeInfo()->sendAnnounceMessage(message);
if (time_passed <= 1) {
+
this->countdownFinished();
this->countdown_mode = false;
}
@@ -210,7 +182,6 @@
}
-
void SpaceRace::end()
{
this->clock_.capture();
Modified: code/branches/RacingBots_FS18/src/modules/gametypes/SpaceRace.h
===================================================================
--- code/branches/RacingBots_FS18/src/modules/gametypes/SpaceRace.h 2018-04-12 13:31:05 UTC (rev 11856)
+++ code/branches/RacingBots_FS18/src/modules/gametypes/SpaceRace.h 2018-04-12 14:09:58 UTC (rev 11857)
@@ -85,8 +85,8 @@
virtual bool allowPawnHit(Pawn* victim, Pawn* originator) override;
virtual bool allowPawnDamage(Pawn* victim, Pawn* originator) override;
virtual bool allowPawnDeath(Pawn* victim, Pawn* originator) override;
- bool countdown_mode = true;
- float time_passed = 11.0f;
+ bool countdown_mode = false;
+ float time_passed = 4.0f;
private:
bool cantMove_; ///< Helper variable, used to stall the engines before the race starts.
More information about the Orxonox-commit
mailing list