Index: /code/branches/OrxoKart_HS18/data/levels/OrxoKart1.oxw
===================================================================
--- /code/branches/OrxoKart_HS18/data/levels/OrxoKart1.oxw	(revision 12127)
+++ /code/branches/OrxoKart_HS18/data/levels/OrxoKart1.oxw	(revision 12128)
@@ -1,5 +1,5 @@
 <LevelInfo
- name = "OrxoKart"
- description = "Level for Minigame OrxoKart"
+ name = "OrxoKart Level 1"
+ description = "Level 1 of Minigame OrxoKart"
  tags = "minigame"
  screenshot = "emptylevel.png"
@@ -20,7 +20,8 @@
 --number of tiles
 N = 11
--- or 25
 --scaling factor
 S = 80
+--level
+L = 1
 
 MAP_ORIGIN = "0,0,0"
@@ -48,9 +49,11 @@
           numCells="<?lua print(N)?>"
           cellSize="<?lua print(S)?>"
-          level=1
+          level="<?lua print(L)?>"
         />
       </attached> 
 
       <collisionShapes>
+        
+        
         <!-- in case of additional collisionShapes besides the floor -->
       </collisionShapes>
Index: /code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKart.cc
===================================================================
--- /code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKart.cc	(revision 12127)
+++ /code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKart.cc	(revision 12128)
@@ -48,5 +48,5 @@
 
         this->origin_ = nullptr;
-        this->numberOfFlags_ = 1;
+        this->raceFinished = false;
         this->firstTick_ = true;
 
@@ -108,4 +108,10 @@
             int *levelcodeArray =  level==1 ? map_1 : map_2;
 
+
+
+            //OrxoKartTile* tile = new OrxoKartTile(origin_->getContext());
+            //tile->init(0*s, 4*s, s, 20, 2);
+
+
             // int z = 0;
             //Generate floor according to levelcode
@@ -114,13 +120,13 @@
                     if (int type = levelcodeArray[i*n + j]) {
                         OrxoKartTile* tile = new OrxoKartTile(origin_->getContext());
-                        tile->init((n-1-i)*s, j*s, s, type);
+                        tile->init((n-1-i)*s, j*s, s, 0, type);
                         // tiles.push_back(tile);
                         //++z;
                         if (level == 1) {
                             //map 1 
-                            if ( i == 10 && j == 4 )
+                            if ( i == 9 && j == 4 )
                                 wayPoints.at(0) = tile;
 
-                            if ( i == 0 && j == 0) 
+                            if ( i == 0 && j == 1) 
                                 wayPoints.at(1) = tile;
                             if ( i == 10 && j == 7)
@@ -129,8 +135,8 @@
                         else if (level == 2) {
                             //map 2
-                            if ( i == 24 && j == 11 )
+                            if ( i == 23 && j == 11 )
                                 wayPoints.at(0) = tile;
 
-                            if ( i == 0 && j == 0) 
+                            if ( i == 0 && j == 1) 
                                 wayPoints.at(1) = tile;
                             if ( i == 24 && j == 17)
@@ -151,14 +157,8 @@
 
         } //firsttick end
-        /*
-        for (std::vector<OrxoKartTile*>::iterator it = tiles.begin(); it != tiles.end(); ++it ) {
-            if ((*it)->getCollided())
-                tiles.erase(it);
-        }
-        if (tiles.empty())
-            numberOfFlags_ = 0;
-        */
+        
         if (wayPointCounter >= 3)
-            numberOfFlags_ = 0;
+            raceFinished = true;
+
         else if (wayPointCounter < 3 && wayPointCounter >= 0 && wayPoints.at(wayPointCounter) != nullptr) {
             if (wayPoints.at(wayPointCounter)->getCollided()) {
@@ -183,5 +183,5 @@
                 player->setPosition(Vector3(s*0, 20, s*8));
             if (level == 2)
-                player->setPosition(Vector3(s*0, 20, s*19));
+                player->setPosition(Vector3(s*0, 20, s*18));
             player->setOrientation(Quaternion(1, 0, 0, 0));   // 0, 0, 0
             player->setVelocity(Vector3(0,0,0));
@@ -190,8 +190,4 @@
             wayPointCounter = 0;
 
-
-            // flag_->destroyLater();
-           // flags_.erase (flags_.begin()+i);
-            //numberOfFlags_ = 0;
         }
         
Index: /code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKart.h
===================================================================
--- /code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKart.h	(revision 12127)
+++ /code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKart.h	(revision 12128)
@@ -55,6 +55,6 @@
                 { this->origin_ = origin; }
 
-            inline int getNumberOfFlags() const
-                { return this->numberOfFlags_; }
+            inline int getRaceFinished() const
+                { return this->raceFinished; }
 
         private:
@@ -65,5 +65,5 @@
             std::vector<OrxoKartTile*> wayPoints;
             int wayPointCounter = 0;
-            int numberOfFlags_;
+            bool raceFinished;
             bool firstTick_;
 
Index: /code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartTile.cc
===================================================================
--- /code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartTile.cc	(revision 12127)
+++ /code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartTile.cc	(revision 12128)
@@ -81,5 +81,5 @@
         type of tile. 1 for normal tile, 2 for Start/End tile      
     */
-    void OrxoKartTile::init(int x, int z, int s, int type)
+    void OrxoKartTile::init(int x, int z, int s, float r, int type)
     {
         // floor design according to its type
@@ -93,4 +93,5 @@
         model_->setScale3D(Vector3(s*1.0f, 8.0f, s*1.0f));
         model_->setPosition(Vector3(x*1.0f, 0.0f, z*1.0f));
+        model_->pitch(Degree(r));
 
         this->attach(model_);
@@ -101,4 +102,5 @@
         cs_->setHalfExtents(Vector3(s/2.0f, 1.0f, s/2.0f));
         cs_->setPosition(Vector3(x*1.0f, -1.0f, z*1.0f));
+        cs_->pitch(Degree(r));
 
         this->attachCollisionShape(cs_);
Index: /code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartTile.h
===================================================================
--- /code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartTile.h	(revision 12127)
+++ /code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartTile.h	(revision 12128)
@@ -50,5 +50,5 @@
             virtual ~OrxoKartTile();
 
-            void init(int x, int z, int s, int type);
+            void init(int x, int z, int s, float r, int type);
 
             virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) override;
Index: /code/branches/OrxoKart_HS18/src/modules/orxokart/TimeHUD.cc
===================================================================
--- /code/branches/OrxoKart_HS18/src/modules/orxokart/TimeHUD.cc	(revision 12127)
+++ /code/branches/OrxoKart_HS18/src/modules/orxokart/TimeHUD.cc	(revision 12128)
@@ -32,4 +32,8 @@
 
 #include "TimeHUD.h"
+
+#include <iostream>
+#include <fstream>
+#include "Highscore.h"
 
 #include "core/CoreIncludes.h"
@@ -82,6 +86,14 @@
         {
             this->setCaption(getTimeString(this->time_));
-            if (this->orxokartGame_->getNumberOfFlags() == 0)
+            if (this->orxokartGame_->getRaceFinished()) {
                 setRunning(false);
+                if (!score_set) {
+                    std::ofstream highscoreFile;
+                    highscoreFile.open("orxokart_highscores.txt", std::ios::app);
+                    highscoreFile << "Name: " << getTimeString(this->time_) << std::endl;
+                    highscoreFile.close();
+                    score_set = true;
+                }
+            }
         }
         
Index: /code/branches/OrxoKart_HS18/src/modules/orxokart/TimeHUD.h
===================================================================
--- /code/branches/OrxoKart_HS18/src/modules/orxokart/TimeHUD.h	(revision 12127)
+++ /code/branches/OrxoKart_HS18/src/modules/orxokart/TimeHUD.h	(revision 12128)
@@ -34,4 +34,6 @@
 
 #include "OrxoKartPrereqs.h"
+#include <iostream>
+#include <fstream>
 
 #include "tools/interfaces/Tickable.h"
@@ -61,4 +63,5 @@
             float time_;
             bool running_;
+            bool score_set = false;
     };
 }
