Index: /code/branches/SpaceRace_HS16/data/levels/newnewnewspacerace.oxw
===================================================================
--- /code/branches/SpaceRace_HS16/data/levels/newnewnewspacerace.oxw	(revision 11280)
+++ /code/branches/SpaceRace_HS16/data/levels/newnewnewspacerace.oxw	(revision 11281)
@@ -1,2 +1,9 @@
+
+  <!-- Authors:
+Louis ...? :D
+Berkay Berabi
+@2016
+-->
+
 <LevelInfo
  name = "New Old Space Race 2"
@@ -5,5 +12,5 @@
  screenshot = "spacerace.png"
 />
-
+   
 <?lua
   include("stats.oxo")
@@ -17,5 +24,5 @@
 <Level
  plugins = "gametypes"
- gametype = "OldSpaceRace"
+ gametype = "SpaceRace"
 >
   <templates>
@@ -181,5 +188,5 @@
     <?lua end ?>
 
-   <!-- ------------------CheckPoints----------------- -->
+   <!-- ------------------CheckPoints----------------- 
    <OldRaceCheckPoint name="checkpoint1" yaw=90 pitch=90 position="1000,30,0" stayActive="true" collisionType="static" scale="1" distance="40" checkpointindex="0" islast="false">
         <attached>
@@ -360,5 +367,269 @@
             <BoxCollisionShape position="-55,0,0"     halfExtents="10, 10, 55" />
         </collisionShapes>
-    </OldRaceCheckPoint> 
+    </OldRaceCheckPoint> -->
+
+
+
+<!-- ---------------------Trying to solve checkpoint problem---------------------- -->
+
+<SpaceRaceManager>
+ <checkpoints>
+    
+
+    <RaceCheckPoint name="checkpoint1" position="1000,30,0" yaw=90 pitch=90 direction="0,1,0" roll="0" collisionType="static" scale="1" distance="40" checkpointindex="0" islast="false" nextcheckpoints="2,-1,-1">
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+
+
+           <collisionShapes>
+
+            <BoxCollisionShape position="0,0,55"     halfExtents="55,10,10" />
+            <BoxCollisionShape position="0,0,-55"      halfExtents="55,10,10" />
+            <BoxCollisionShape position="55,0,0"      halfExtents="10,10,55" />
+            <BoxCollisionShape position="-55,0,0"       halfExtents="10,10,55" />
+
+        </collisionShapes>
+    </RaceCheckPoint>
+
+
+
+<RaceCheckPoint name="checkpoint2" yaw=90 pitch=90 position="3000,200,100" direction="0,1,0" roll="0" collisionType="static" scale="1" distance="40" checkpointindex="1" islast="false" nextcheckpoints="3,-1,-1">
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+       <collisionShapes>
+
+
+           <BoxCollisionShape position="0,0,55"     halfExtents="55,10,10" />
+            <BoxCollisionShape position="0,0,-55"      halfExtents="55,10,10" />
+            <BoxCollisionShape position="55,0,0"      halfExtents="10,10,55" />
+            <BoxCollisionShape position="-55,0,0"       halfExtents="10,10,55" />
+
+
+        </collisionShapes>
+
+    </RaceCheckPoint>
+
+
+<RaceCheckPoint name="checkpoint3" yaw=90 pitch=90 position="5000,100,300" direction="0,1,0" roll="0" collisionType="static" scale="1" distance="40" checkpointindex="2" islast="false" nextcheckpoints="4,-1,-1">
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+        <collisionShapes>
+
+
+        <BoxCollisionShape position="0,0,55"     halfExtents="55,10,10" />
+            <BoxCollisionShape position="0,0,-55"      halfExtents="55,10,10" />
+            <BoxCollisionShape position="55,0,0"      halfExtents="10,10,55" />
+            <BoxCollisionShape position="-55,0,0"       halfExtents="10,10,55" />
+
+
+        </collisionShapes>
+
+    </RaceCheckPoint>
+
+
+<RaceCheckPoint name="checkpoint4"  yaw=90 pitch=90 position="8000,-150,150" direction="0,1,0" roll="0" collisionType="static" scale="1" distance="40" checkpointindex="3" islast="false" nextcheckpoints="5,-1,-1">
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+        <collisionShapes>
+
+
+             <BoxCollisionShape position="0,0,55"     halfExtents="55,10,10" />
+            <BoxCollisionShape position="0,0,-55"      halfExtents="55,10,10" />
+            <BoxCollisionShape position="55,0,0"      halfExtents="10,10,55" />
+            <BoxCollisionShape position="-55,0,0"       halfExtents="10,10,55" />
+
+
+        </collisionShapes>
+
+    </RaceCheckPoint>
+
+
+<RaceCheckPoint name="checkpoint5"  yaw=90 pitch=90 position="10000,-200,200" direction="0,1,0" roll="0" collisionType="static" scale="1" distance="40" checkpointindex="4" islast="false" nextcheckpoints="6,-1,-1">
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+       <collisionShapes>
+
+
+     <BoxCollisionShape position="0,0,55"     halfExtents="55,10,10" />
+            <BoxCollisionShape position="0,0,-55"      halfExtents="55,10,10" />
+            <BoxCollisionShape position="55,0,0"      halfExtents="10,10,55" />
+            <BoxCollisionShape position="-55,0,0"       halfExtents="10,10,55" />
+
+
+        </collisionShapes>
+    </RaceCheckPoint>
+
+
+
+<RaceCheckPoint name="checkpoint6" yaw=90 pitch=90 position="13000,100,100" direction="0,1,0" roll="0" collisionType="static" scale="1" distance="40" checkpointindex="5" islast="false" nextcheckpoints="7,-1,-1">
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+      <collisionShapes>
+
+
+            <BoxCollisionShape position="0,0,55"     halfExtents="55,10,10" />
+            <BoxCollisionShape position="0,0,-55"      halfExtents="55,10,10" />
+            <BoxCollisionShape position="55,0,0"      halfExtents="10,10,55" />
+            <BoxCollisionShape position="-55,0,0"       halfExtents="10,10,55" />
+
+
+        </collisionShapes>
+
+    </RaceCheckPoint>
+
+
+
+<RaceCheckPoint name="checkpoint7" yaw=90 pitch=90 position="15000,0,0" direction="0,1,0" roll="0" collisionType="static" scale="1" distance="40" checkpointindex="6" islast="false" nextcheckpoints="8,-1,-1">
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+       <collisionShapes>
+
+               <BoxCollisionShape position="0,0,55"     halfExtents="55,10,10" />
+            <BoxCollisionShape position="0,0,-55"      halfExtents="55,10,10" />
+            <BoxCollisionShape position="55,0,0"      halfExtents="10,10,55" />
+            <BoxCollisionShape position="-55,0,0"       halfExtents="10,10,55" />
+
+        </collisionShapes>
+    </RaceCheckPoint>
+
+
+<RaceCheckPoint name="checkpoint8" yaw=90 pitch=90 position="18000,150,-150" direction="0,1,0" roll="0" collisionType="static" scale="1" distance="40" checkpointindex="7" islast="false" nextcheckpoints="9,-1,-1">
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+         <collisionShapes>
+
+    <BoxCollisionShape position="0,0,55"     halfExtents="55,10,10" />
+            <BoxCollisionShape position="0,0,-55"      halfExtents="55,10,10" />
+            <BoxCollisionShape position="55,0,0"      halfExtents="10,10,55" />
+            <BoxCollisionShape position="-55,0,0"       halfExtents="10,10,55" />
+
+
+        </collisionShapes>
+
+    </RaceCheckPoint>
+
+
+<RaceCheckPoint name="checkpoint9" yaw=90 pitch=90 position="21000,120,-120" direction="0,1,0" roll="0" collisionType="static" scale="1" distance="40" checkpointindex="8" islast="false" nextcheckpoints="10,-1,-1">
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+       <collisionShapes>
+
+
+         <BoxCollisionShape position="0,0,55"     halfExtents="55,10,10" />
+            <BoxCollisionShape position="0,0,-55"      halfExtents="55,10,10" />
+            <BoxCollisionShape position="55,0,0"      halfExtents="10,10,55" />
+            <BoxCollisionShape position="-55,0,0"       halfExtents="10,10,55" />
+
+
+        </collisionShapes>
+
+    </RaceCheckPoint>
+
+<RaceCheckPoint name="checkpoint10" yaw=90 pitch=90 position="24000,-150,-80" direction="0,1,0" roll="0" collisionType="static" scale="1" distance="40" checkpointindex="9" islast="false" nextcheckpoints="11,-1,-1">
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+       <collisionShapes>
+
+
+           <BoxCollisionShape position="0,0,55"     halfExtents="55,10,10" />
+            <BoxCollisionShape position="0,0,-55"      halfExtents="55,10,10" />
+            <BoxCollisionShape position="55,0,0"      halfExtents="10,10,55" />
+            <BoxCollisionShape position="-55,0,0"       halfExtents="10,10,55" />
+
+
+        </collisionShapes>
+
+    </RaceCheckPoint>
+
+<RaceCheckPoint name="checkpoint11" yaw=90 pitch=90 position="27000,-200,0" direction="0,1,0" roll="0" collisionType="static" scale="1" distance="40" checkpointindex="10" islast="false" nextcheckpoints="12,-1,-1">
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+      <collisionShapes>
+
+    <BoxCollisionShape position="0,0,55"     halfExtents="55,10,10" />
+            <BoxCollisionShape position="0,0,-55"      halfExtents="55,10,10" />
+            <BoxCollisionShape position="55,0,0"      halfExtents="10,10,55" />
+            <BoxCollisionShape position="-55,0,0"       halfExtents="10,10,55" />
+
+        </collisionShapes>
+
+    </RaceCheckPoint>
+
+
+
+<RaceCheckPoint name="checkpoint12" yaw=90 pitch=90 position="30000,-50,50" direction="0,1,0" roll="0" collisionType="static" scale="1" distance="40" checkpointindex="11" islast="false" nextcheckpoints="13,-1,-1">
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+       <collisionShapes>
+    <BoxCollisionShape position="0,0,55"     halfExtents="55,10,10" />
+            <BoxCollisionShape position="0,0,-55"      halfExtents="55,10,10" />
+            <BoxCollisionShape position="55,0,0"      halfExtents="10,10,55" />
+            <BoxCollisionShape position="-55,0,0"       halfExtents="10,10,55" />
+
+        </collisionShapes>
+    </RaceCheckPoint>
+
+
+<RaceCheckPoint name="checkpoint13" yaw=90 pitch=90 position="33000,80,60" direction="0,1,0" roll="0" collisionType="static" scale="1" distance="40" checkpointindex="12" islast="true" >
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+       <collisionShapes>
+
+           <BoxCollisionShape position="0,0,55"     halfExtents="55,10,10" />
+            <BoxCollisionShape position="0,0,-55"      halfExtents="55,10,10" />
+            <BoxCollisionShape position="55,0,0"      halfExtents="10,10,55" />
+            <BoxCollisionShape position="-55,0,0"       halfExtents="10,10,55" />
+
+        </collisionShapes>
+    </RaceCheckPoint>
+
+
+
+<RaceCheckPoint name="checkpoint14" yaw=90 pitch=90 position="35000,120,20" direction="0,1,0" roll="0" collisionType="static" scale="1" distance="40" checkpointindex="13" islast="true" >
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+       <collisionShapes>
+
+           <BoxCollisionShape position="0,0,55"     halfExtents="55,10,10" />
+            <BoxCollisionShape position="0,0,-55"      halfExtents="55,10,10" />
+            <BoxCollisionShape position="55,0,0"      halfExtents="10,10,55" />
+            <BoxCollisionShape position="-55,0,0"       halfExtents="10,10,55" />
+
+        </collisionShapes>
+    </RaceCheckPoint>
+
+<RaceCheckPoint name="checkpoint15" yaw=90 pitch=90 position="38000,80,0" direction="0,1,0" roll="0" collisionType="static" scale="1" distance="40" checkpointindex="14" islast="true" >
+        <attached>
+            <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+        </attached>
+       <collisionShapes>
+
+           <BoxCollisionShape position="0,0,55"     halfExtents="55,10,10" />
+            <BoxCollisionShape position="0,0,-55"      halfExtents="55,10,10" />
+            <BoxCollisionShape position="55,0,0"      halfExtents="10,10,55" />
+            <BoxCollisionShape position="-55,0,0"       halfExtents="10,10,55" />
+
+        </collisionShapes>
+    </RaceCheckPoint>
+
+
+</checkpoints>
+</SpaceRaceManager>
+
+
 
 <!-- ---------------------PickUps---------------------- -->
Index: /code/branches/SpaceRace_HS16/src/modules/gametypes/SpaceRace.cc
===================================================================
--- /code/branches/SpaceRace_HS16/src/modules/gametypes/SpaceRace.cc	(revision 11280)
+++ /code/branches/SpaceRace_HS16/src/modules/gametypes/SpaceRace.cc	(revision 11281)
@@ -29,4 +29,19 @@
 #include "SpaceRace.h"
 
+#include "core/CoreIncludes.h"
+#include "chat/ChatManager.h"
+#include "util/Convert.h"
+#include "util/Math.h"
+#include "infos/Bot.h"
+#include "items/Engine.h"
+#include "controllers/HumanController.h"
+
+#include "core/CoreIncludes.h"
+#include "chat/ChatManager.h"
+#include "infos/PlayerInfo.h"
+#include "worldentities/pawns/Pawn.h"
+#include "core/config/ConfigValueIncludes.h"
+#include "infos/Bot.h"
+#include "SpaceRaceBot.h"
 #include "items/Engine.h"
 
@@ -49,10 +64,42 @@
         this->cantMove_ = false;
         this->bTimeIsUp_ = false;
-        this->numberOfBots_ = 1; // quick fix: don't allow default-bots to enter the race
+        this->setConfigValues();
+
+       // this->numberOfBots_ = 1; // quick fix: don't allow default-bots to enter the race
                                  // remove this line, if a raceBot has been created.
     }
 
-
-
+  void SpaceRace::setConfigValues()
+    {
+       
+    
+    }
+
+    void SpaceRace::start()
+    {
+        Gametype::start();
+
+   if (true)
+        {
+            this->spawnPlayersIfRequested();
+            this->cantMove_ = true;
+
+            for (Engine* engine : ObjectList<Engine>()){
+                engine->setActive(false);
+                
+
+            }
+            
+        }
+
+
+
+        std::string message("BE FAST BE FIRST");
+        this->getGametypeInfo()->sendAnnounceMessage(message);
+        ChatManager::message(message);
+
+Timer* countdownTimer = new Timer();
+        countdownTimer->setTimer(11, false, createExecutor(createFunctor(&SpaceRace::countdownFinished, this)));
+    }
 
 
@@ -84,12 +131,10 @@
     }
 
-    
-
-
-
-
-    void SpaceRace::tick(float dt)
+
+void SpaceRace::tick(float dt)
     {
         SUPER(SpaceRace,tick,dt);
+
+
 
         // spawns the players when the countdown starts, but deactivates their engines
@@ -103,4 +148,30 @@
         }
 
+
+gtInfo_->setStartCountdown(10.0);
+   
+        
+            /*this->spawnPlayersIfRequested();
+            this->cantMove_ = true;
+
+            for (Engine* engine : ObjectList<Engine>()){
+                engine->setActive(false);
+                }
+
+            
+            
+         std::string message("BE FAST BE FIRST");
+        this->getGametypeInfo()->sendAnnounceMessage(message);
+        ChatManager::message(message);
+
+Timer* countdownTimer = new Timer();
+        countdownTimer->setTimer(11, false, createExecutor(createFunctor(&SpaceRace::countdownFinished, this)));*/
+
+
+
+
+
+
+
         // activate the engines when the countdown ends
         if (!this->isStartCountdownRunning() && this->cantMove_)
@@ -113,14 +184,10 @@
 
 
-            std::string message = "Hello!";
+            std::string message = "RACE STARTED!";
             this->getGametypeInfo()->sendAnnounceMessage(message);
             ChatManager::message(message);
         }
-    }
-
-
-
-
-
+    
+}
 
     void SpaceRace::newCheckpointReached(RaceCheckPoint* checkpoint, PlayerInfo* player)
@@ -138,4 +205,38 @@
     }
 
+ void SpaceRace::countdownFinished()
+    {
+
+        std::string message("RACE STARTED ");
+        this->getGametypeInfo()->sendAnnounceMessage(message);
+        ChatManager::message(message);
+
+
+    for (Engine* engine : ObjectList<Engine>())
+                engine->setActive(true);
+    
+}
+
+ void SpaceRace::playerEntered(PlayerInfo* player)
+    {
+        Gametype::playerEntered(player);
+
+        const std::string& message = player->getName() + " entered the game";
+        ChatManager::message(message);
+    }
+
+
+ void SpaceRace::addBots(unsigned int amount)
+    {
+        for (unsigned int i = 0; i < amount; ++i)
+            this->botclass_.fabricate(this->getContext());
+    }
+
+
+
+
+
+
+
     bool SpaceRace::allowPawnHit(Pawn* victim, Pawn* originator)
     {
Index: /code/branches/SpaceRace_HS16/src/modules/gametypes/SpaceRace.h
===================================================================
--- /code/branches/SpaceRace_HS16/src/modules/gametypes/SpaceRace.h	(revision 11280)
+++ /code/branches/SpaceRace_HS16/src/modules/gametypes/SpaceRace.h	(revision 11281)
@@ -57,10 +57,22 @@
             virtual ~SpaceRace() {}
 
+             void setConfigValues();
 
             virtual void tick(float dt) override;
+            virtual void start() override;
+            virtual void end() override;
+ virtual void countdownFinished();
+             virtual void addBots(unsigned int amount) override; //<! overwrite function in order to bypass the addbots command.
 
-            virtual void end() override;
+
+
+             virtual void playerEntered(PlayerInfo* player) override;
+
+            //virtual void newCheckpointReached();
 
             void newCheckpointReached(RaceCheckPoint* checkpoint, PlayerInfo* player);
+            
+
+
             inline RaceCheckPoint* getCheckpointReached(PlayerInfo* player)
                 { return this->checkpointReached_[player]; }
Index: /code/branches/SpaceRace_HS16/src/modules/gametypes/SpaceRaceBot.cc
===================================================================
--- /code/branches/SpaceRace_HS16/src/modules/gametypes/SpaceRaceBot.cc	(revision 11280)
+++ /code/branches/SpaceRace_HS16/src/modules/gametypes/SpaceRaceBot.cc	(revision 11281)
@@ -41,11 +41,5 @@
     SpaceRaceBot::SpaceRaceBot(Context* context) : Bot(context){
         RegisterObject(SpaceRaceBot);
-        this->defaultController_ = Class(AIController);// ClassByString("")
-        
-
-
-
-
-
+        this->defaultController_ = Class(SpaceRaceController);// ClassByString("")
         this->createController();
 
Index: /code/branches/SpaceRace_HS16/src/modules/gametypes/SpaceRaceManager.cc
===================================================================
--- /code/branches/SpaceRace_HS16/src/modules/gametypes/SpaceRaceManager.cc	(revision 11280)
+++ /code/branches/SpaceRace_HS16/src/modules/gametypes/SpaceRaceManager.cc	(revision 11281)
@@ -48,5 +48,5 @@
         this->race_ = orxonox_cast<SpaceRace*>(this->getGametype());
         assert(race_);
-        amountOfPlayers=(race_->getPlayers()).size();
+        //amountOfPlayers=(race_->getPlayers()).size();
         this->firstcheckpointvisible_ = false;
     }
Index: /code/branches/SpaceRace_HS16/src/orxonox/infos/GametypeInfo.h
===================================================================
--- /code/branches/SpaceRace_HS16/src/orxonox/infos/GametypeInfo.h	(revision 11280)
+++ /code/branches/SpaceRace_HS16/src/orxonox/infos/GametypeInfo.h	(revision 11281)
@@ -83,4 +83,5 @@
             inline bool isStartCountdownRunning() const
                 { return this->bStartCountdownRunning_; }
+            
             void changedStartCountdownRunning(void); // Is called when the start countdown has been either started or stopped.
 
