[Orxonox-commit 6692] r11322 - code/branches/SpaceRace_HS16/src/modules/gametypes

bberabi at orxonox.net bberabi at orxonox.net
Mon Dec 5 16:15:27 CET 2016


Author: bberabi
Date: 2016-12-05 16:15:27 +0100 (Mon, 05 Dec 2016)
New Revision: 11322

Modified:
   code/branches/SpaceRace_HS16/src/modules/gametypes/SpaceRace.cc
Log:
we found how to set starpositions

Modified: code/branches/SpaceRace_HS16/src/modules/gametypes/SpaceRace.cc
===================================================================
--- code/branches/SpaceRace_HS16/src/modules/gametypes/SpaceRace.cc	2016-12-05 15:08:31 UTC (rev 11321)
+++ code/branches/SpaceRace_HS16/src/modules/gametypes/SpaceRace.cc	2016-12-05 15:15:27 UTC (rev 11322)
@@ -51,7 +51,9 @@
 #include "util/Math.h"
 #include "SpaceRaceBot.h"
 #include "items/Engine.h"
+#include <vector>
 
+
 namespace orxonox
 {
     RegisterUnloadableClass(SpaceRace);
@@ -77,6 +79,31 @@
 
     void SpaceRace::start()
     {
+
+
+        std::vector<int> spawnpositions;
+        
+        spawnpositions.push_back(200);
+        spawnpositions.push_back(0);
+        spawnpositions.push_back(100);
+        
+        spawnpositions.push_back(200);
+        spawnpositions.push_back(200);
+        spawnpositions.push_back(0);
+        
+        spawnpositions.push_back(200);
+        spawnpositions.push_back(0);
+        spawnpositions.push_back(0);
+
+        spawnpositions.push_back(100);
+        spawnpositions.push_back(0);
+        spawnpositions.push_back(0);
+
+        spawnpositions.push_back(0);
+        spawnpositions.push_back(100);
+        spawnpositions.push_back(0);
+
+
         Gametype::start();
    if (true)
         {
@@ -88,11 +115,23 @@
                 
 
             }
-            
+           
+           int a,b,c;
+            a=0;
+            b=1;
+            c=2;
+              for (SpaceRaceBot* bot : ObjectList<SpaceRaceBot>()){
+                bot->getControllableEntity()->setPosition(spawnpositions.at(a),spawnpositions.at(b),spawnpositions.at(c));
+               a= a+3;
+               b = b+3; 
+               c+= 3;
+            }
+
+
         }
 
 
-
+                
         std::string message("BE FAST BE FIRST");
         this->getGametypeInfo()->sendAnnounceMessage(message);
         ChatManager::message(message);
@@ -136,18 +175,18 @@
 
 
 
-       /* // spawns the players when the countdown starts, but deactivates their engines
-        if (this->isStartCountdownRunning() && !this->cantMove_)
+        // spawns the players when the countdown starts, but deactivates their engines
+       /* if (this->isStartCountdownRunning() && !this->cantMove_)
         {
             this->spawnPlayersIfRequested();
             this->cantMove_ = true;
 
             for (Engine* engine : ObjectList<Engine>())
                 engine->setActive(false);
-        }
+        }*/
 
 
-gtinfo_->setStartCountdown(50.0);
+//gtinfo_->setStartCountdown(50.0);
    
         
 
@@ -158,7 +197,7 @@
 
 
         // activate the engines when the countdown ends
-        if (!this->isStartCountdownRunning() && this->cantMove_)
+      /*  if (!this->isStartCountdownRunning() && this->cantMove_)
         {
             for (Engine* engine : ObjectList<Engine>())
                 engine->setActive(true);
@@ -217,19 +256,15 @@
 
  void SpaceRace::addBots(unsigned int amount)
     {
-        for (unsigned int i = 1; i <= amount/2; ++i){
+        for (unsigned int i = 1; i <= amount; ++i){
             this->botclass_.fabricate(this->getContext());
             //SpaceRaceBot* bot = new SpaceRaceBot(this->getContext());
             //bot->setPosition(-i*150,0,-i*100);
         }
-        for (unsigned int i = 1; i <= amount/2; ++i){
-            this->botclass_.fabricate(this->getContext());
-            //SpaceRaceBot* bot = new SpaceRaceBot(this->getContext());
-            //bot->setPosition(-i*150,0,i*100);
-        }
 
 
 
+
     }
 
 




More information about the Orxonox-commit mailing list