Index: /code/branches/TixyTaxyTorxy_HS18/data/levels/TixyTaxyTorxy.oxw
===================================================================
--- /code/branches/TixyTaxyTorxy_HS18/data/levels/TixyTaxyTorxy.oxw	(revision 12148)
+++ /code/branches/TixyTaxyTorxy_HS18/data/levels/TixyTaxyTorxy.oxw	(revision 12149)
@@ -23,5 +23,5 @@
   <TixyTaxyTorxySelecter>
     <camerapositions>
-      <CameraPosition position="0,0,1300" lookat="0,0,0" absolute=true drag=true mouselook=true/>
+      <CameraPosition position="0,0,2000" lookat="0,0,0" absolute=false drag=true mouselook=true/>
     </camerapositions>
   </TixyTaxyTorxySelecter>
@@ -239,27 +239,24 @@
     tower4Template=tower4template
     tower5Template=tower5template
-    tower1Cost=100
-    tower2Cost=100
-    tower3Cost=100
-    tower4Cost=100
-    tower5Cost=100
-    fields="S1S1S1S1S1S1S1S1S1S1S1S1S1S1S1S1
-            S1S1S1S1S1S1S1S1S1S1S1S1S1S1S1S1
-            S1S1F1F1F1O1F1F1F1O1F1F1F1S1S1S1
-            S1S1F1F1F1O1F1F1F1O1F1F1F1S1S1S1
-            S1S1F1F1F1O1F1F1F1O1F1F1F1S1S1S1
-            S1S1O1O1O1O1O1O1O1O1O1O1O1S1S1S1
-            S1S1F1F1F1O1F1F1F1O1F1F1F1S1S1S1
-            S1S1F1F1F1O1F1F1F1O1F1F1F1S1S1S1
-            S1S1F1F1F1O1F1F1F1O1F1F1F1S1S1S1
-            S1S1O1O1O1O1O1O1O1O1O1O1O1S1S1S1
-            S1S1F1F1F1O1F1F1F1O1F1F1F1S1S1S1
-            S1S1F1F1F1O1F1F1F1O1F1F1F1S1S1S1
-            S1S1F1F1F1O1F1F1F1O1F1F1F1S1S1S1
-            S1S1S1S1S1S1S1S1S1S1S1S1S1S1S1S1
-            S1S1S1S1S1S1S1S1S1S1S1S1S1S1S1S1
-            S1S1S1S1S1S1S1S1S1S1S1S1S1S1S1S1"
-    width=16
-    height=16
+    tower1Cost=0
+    tower2Cost=0
+    tower3Cost=0
+    tower4Cost=0
+    tower5Cost=0
+    fields="
+            F1F1F1O1F1F1F1O1F1F1F1
+            F1F1F1O1F1F1F1O1F1F1F1
+            F1F1F1O1F1F1F1O1F1F1F1
+            O1O1O1O1O1O1O1O1O1O1O1
+            F1F1F1O1F1F1F1O1F1F1F1
+            F1F1F1O1F1F1F1O1F1F1F1
+            F1F1F1O1F1F1F1O1F1F1F1
+            O1O1O1O1O1O1O1O1O1O1O1
+            F1F1F1O1F1F1F1O1F1F1F1
+            F1F1F1O1F1F1F1O1F1F1F1
+            F1F1F1O1F1F1F1O1F1F1F1
+            "
+    width=11
+    height=11
     tileScale=100
     position="0,0,0"
@@ -267,9 +264,5 @@
     collisionType=dynamic
     mass=100000
-    >
-      <camerapositions>
-        <CameraPosition position="0,0,1400" lookat="0,0,0" absolute=true />
-      </camerapositions>    
-    </TixyTaxyTorxyCenterpoint>
+    />
 
   </Scene>
Index: /code/branches/TixyTaxyTorxy_HS18/data/overlays/TixyTaxyTorxyHUD.oxo
===================================================================
--- /code/branches/TixyTaxyTorxy_HS18/data/overlays/TixyTaxyTorxyHUD.oxo	(revision 12148)
+++ /code/branches/TixyTaxyTorxy_HS18/data/overlays/TixyTaxyTorxyHUD.oxo	(revision 12149)
@@ -25,5 +25,5 @@
      align     = "left"
      showlives = false
-     showcredits = true
+     showcredits = false
      showwaves = false
     />
@@ -37,5 +37,5 @@
      align     = "left"
 
-     caption = "Lifes:"
+     caption = "Round:"
     />
     
@@ -60,5 +60,5 @@
      align     = "left"
 
-     caption = "Waves:"
+     caption = "Player:"
     />
     
Index: /code/branches/TixyTaxyTorxy_HS18/src/modules/TixyTaxyTorxy/TixyTaxyTorxy.cc
===================================================================
--- /code/branches/TixyTaxyTorxy_HS18/src/modules/TixyTaxyTorxy/TixyTaxyTorxy.cc	(revision 12148)
+++ /code/branches/TixyTaxyTorxy_HS18/src/modules/TixyTaxyTorxy/TixyTaxyTorxy.cc	(revision 12149)
@@ -83,8 +83,14 @@
 #include "core/CoreIncludes.h"
 #include "Highscore.h"
+#include <iostream>
+#include "TixyTaxyTorxyField.h"
+using namespace std;
 
 namespace orxonox
 {
+
     RegisterUnloadableClass(TixyTaxyTorxy);
+
+
 
     
@@ -103,8 +109,11 @@
         this->waveSize_ = 0;
         offset_ = Vector3(0,0,10);
+
     }
 
 TixyTaxyTorxy::~TixyTaxyTorxy()
     {
+
+
         if (this->isInitialized())
         {
@@ -186,16 +195,131 @@
     void TixyTaxyTorxy::addTower(int x,int y)
     {
+        int mini;
+         
         TixyTaxyTorxyCoordinate* coord = new TixyTaxyTorxyCoordinate(x,y);
         x = coord->GetX();
         y = coord->GetY();
-
+        mini = coord->Getmini();
+
+        orxout() <<"addTower("<<x<<", "<<y<<") "<<mini<<"" <<endl;
         int cost = center_->getTowerCost(1);
 
-        if (fields_[x][y]->isFree() == true && getCredit() >= cost)
+        if (fields_[x][y]->isFree())
         {
             payCredit(cost);
             fields_[x][y]->createTower(1);
         }
-    }
+    
+    bool player1=player2=0;
+    int A1,B1,C1,D1,E1,F1,G1,H1,I1;
+    int A2,B2,C2,D2,E2,F2,G2,H2,I2;
+    A1=B1=C1=D1=E1=F1=G1=H1=I1=0;
+    A2=B2=C2=D2=E2=F2=G2=H2=I2=0;
+
+
+
+    if (checkMinigame(0,10) == 1) A1=1;
+    if (checkMinigame(4,10) == 1) B1=2;
+    if (checkMinigame(8,10) == 1) C1=4;
+    if (checkMinigame(0,6) == 1) D1=8;
+    if (checkMinigame(4,6) == 1) E1=16;
+    if (checkMinigame(8,6) == 1) F1=32;
+    if (checkMinigame(0,2) == 1) G1=64;
+    if (checkMinigame(4,2) == 1) H1=128;
+    if (checkMinigame(8,2) == 1) I1=256;
+
+    if (checkMinigame(0,10) == 2) A2=1;
+    if (checkMinigame(4,10) == 2) B2=2;
+    if (checkMinigame(8,10) == 2) C2=4;
+    if (checkMinigame(0,6) == 2) D2=8;
+    if (checkMinigame(4,6) == 2) E2=16;
+    if (checkMinigame(8,6) == 2) F2=32;
+    if (checkMinigame(0,2) == 2) G2=64;
+    if (checkMinigame(4,2) == 2) H2=128;
+    if (checkMinigame(8,2) == 2) I2=256;
+
+    orxout()<<"A1: "<<A1<<"B1: "<<B1<<endl;
+
+    if(A1+B1+C1 == 7 || D1+E1+F1 == 56 || G1+H1+I1 == 448 || A1+D1+G1 == 73 || B1+E1+H1 == 146 || C1+F1+I1 == 294 || A1+E1+I1 == 273 || C1+E1+G1 == 84){
+
+        player1=1;
+        orxout()<<"player1 has won" << endl;
+    }
+
+     if(A2+B2+C2 == 7 || D2+E2+F2 == 56 || G2+H2+I2 == 448 || A2+D2+G2 == 73 || B2+E2+H2 == 146 || C2+F2+I2 == 294 || A2+E2+I2 == 273 || C2+E2+G2 == 84){
+
+        player2=1;
+        orxout()<<"player1 has won" << endl;
+    }
+    }
+
+    int TixyTaxyTorxy::checkMinigame(int x, int y){
+        if (checkRow(x,y)==1 || checkColumn(x,y)==1 || checkDiagLtR(x,y)==1 ||checkDiagRtL(x,y)==1) return 1;
+        else if (checkRow(x,y)==2 || checkColumn(x,y)==2 || checkDiagLtR(x,y)==2 || checkDiagRtL (x,y)==2) return 2;
+        return 0;
+         }  
+
+    int TixyTaxyTorxy::checkRow(int x, int y){
+        for(int i=0; i<2; i++){
+
+            if(fields_[x+i][y]-> isTower1() && fields_[x+i][y-1]-> isTower1() && fields_[x+i][y-2]-> isTower1()){
+                return 1;
+
+            }else if(fields_[x+i][y]-> isTower2() && fields_[x+i][y-1]-> isTower2() && fields_[x+i][y-2]-> isTower2()){
+                return 2;}   
+        }
+        return 0;
+
+    }
+    int TixyTaxyTorxy::checkColumn(int x, int y){
+        for(int i=0; i<2; i++){
+
+            if(fields_[x][y-i]-> isTower1() && fields_[x+1][y-i]-> isTower1() && fields_[x+2][y-i]-> isTower1()){
+                return 1;
+
+            }else if (fields_[x][y-i]-> isTower2() && fields_[x+1][y-i]-> isTower2() && fields_[x+2][y-i]-> isTower2()){
+            return 2;            }
+        }
+            return 0;
+        
+        
+    }
+    //Cheeck the diagonal achsis from top left to bottom right
+    int TixyTaxyTorxy::checkDiagLtR(int x, int y){
+
+        if (fields_[x][y]-> isTower1() && fields_[x+1][y-1]-> isTower1() && fields_[x+2][y-2]-> isTower1()){
+            return 1;
+        }
+        else if (fields_[x][y]-> isTower2() && fields_[x+1][y-1]-> isTower2() && fields_[x+2][y-2]-> isTower2()){
+            return 2;
+        }
+        return 0;
+        
+    }
+    //Cheeck the diagonal achsis from top right to bottom left
+    int TixyTaxyTorxy::checkDiagRtL (int x, int y){
+
+        if(fields_[x+2][y]-> isTower1() && fields_[x+1][y-1]-> isTower1() && fields_[x][y-2]-> isTower1()){
+            return 1;
+        }
+        else if(fields_[x+2][y]-> isTower2() && fields_[x+1][y-1]-> isTower2() && fields_[x][y-2]-> isTower2()){
+            return 2;
+        }
+        
+        else return 0;
+        }
+
+    bool TixyTaxyTorxy::getPlayer1Value(){
+    return player1;
+}
+    bool TixyTaxyTorxy::getPlayer2Value(){
+    return player2;
+}
+    
+
+
+
+
+
 
     /*adds Tower at Position (x,y) and reduces credit and adds the point to the towermatrix. template ("towerturret")
@@ -253,7 +377,7 @@
         std::string fields = center_->getFields();
         int pos = 0;
-        for (int j = 15; j >= 0; --j)
-        {
-            for (int i = 0; i < 16; ++i)
+        for (int j = 10; j >= 0; --j)
+        {
+            for (int i = 0; i < 11; ++i)
             {
                 coord.Set(i,j);
Index: /code/branches/TixyTaxyTorxy_HS18/src/modules/TixyTaxyTorxy/TixyTaxyTorxy.h
===================================================================
--- /code/branches/TixyTaxyTorxy_HS18/src/modules/TixyTaxyTorxy/TixyTaxyTorxy.h	(revision 12148)
+++ /code/branches/TixyTaxyTorxy_HS18/src/modules/TixyTaxyTorxy/TixyTaxyTorxy.h	(revision 12149)
@@ -72,4 +72,11 @@
         void addTower(int x, int y);
         void upgradeTower(int x, int y);
+        int checkRow(int x, int y);
+        int checkColumn(int x, int y);
+        int checkMinigame(int x, int y);
+        int checkDiagLtR(int x, int y);
+        int checkDiagRtL(int x, int y);
+        bool getPlayer2Value();
+        bool getPlayer1Value();
         
         TixyTaxyTorxySelecter* selecter;        
@@ -86,5 +93,7 @@
         int waveNumber_;
         int lifes_;
-        TixyTaxyTorxyField* fields_[16][16];
+        bool player1;
+        bool player2;
+        TixyTaxyTorxyField* fields_[11][11];
         std::vector<orxonox::WeakPtr<TixyTaxyTorxyField>> waypoints_;
         Vector3 endpoint_;
Index: /code/branches/TixyTaxyTorxy_HS18/src/modules/TixyTaxyTorxy/TixyTaxyTorxyCenterpoint.cc
===================================================================
--- /code/branches/TixyTaxyTorxy_HS18/src/modules/TixyTaxyTorxy/TixyTaxyTorxyCenterpoint.cc	(revision 12148)
+++ /code/branches/TixyTaxyTorxy_HS18/src/modules/TixyTaxyTorxy/TixyTaxyTorxyCenterpoint.cc	(revision 12149)
@@ -56,6 +56,6 @@
         RegisterObject(TixyTaxyTorxyCenterpoint);
 
-        this->width_ = 15;
-        this->height_ = 15;
+        this->width_ = 10;
+        this->height_ = 10;
 
         //this->setCollisionType(Static);
Index: /code/branches/TixyTaxyTorxy_HS18/src/modules/TixyTaxyTorxy/TixyTaxyTorxyCoordinate.cc
===================================================================
--- /code/branches/TixyTaxyTorxy_HS18/src/modules/TixyTaxyTorxy/TixyTaxyTorxyCoordinate.cc	(revision 12148)
+++ /code/branches/TixyTaxyTorxy_HS18/src/modules/TixyTaxyTorxy/TixyTaxyTorxyCoordinate.cc	(revision 12149)
@@ -20,4 +20,5 @@
     {        
         Set(x,y);
+
     }
 
@@ -28,7 +29,7 @@
             _x = 0;
         }
-        else if (x > 15)
+        else if (x > 10)
         {
-            _x = 15;
+            _x = 10;
         }
         else
@@ -41,7 +42,7 @@
             _y = 0;
         }
-        else if (y > 15)
+        else if (y > 10)
         {
-            _y = 15;
+            _y = 10;
         }
         else
@@ -49,4 +50,24 @@
             _y = y;
         }
+
+        //Defniert die Positionen der einzelnen Minigames
+
+        if( _x <= 2 && _y >= 8 ) _mini = 1;
+
+        if( _x>= 4 &&_x <= 6 && _y >= 8 ) _mini = 2; 
+
+        if( _x>= 8 && _y >= 8 ) _mini = 3; 
+
+        if( _x <= 2 && _y >= 4 && _y<=6 ) _mini = 4; 
+
+        if(_x>=4 &&_x <= 6 &&  _y>=4 &&_y <= 6 ) _mini = 5; 
+
+        if( _x >=8 && _y >= 4 && _y<=6 ) _mini = 6; 
+
+        if( _x <= 2 && _y <=2 ) _mini = 7; 
+
+        if( _x >=4 &&_x <= 6 && _y <=2 ) _mini = 8;
+
+        if( _x >= 8 && _y <=2 ) _mini = 9;  
     }
 
@@ -60,5 +81,8 @@
         return _y;
     }
-
+    int TixyTaxyTorxyCoordinate::Getmini()
+    {        
+        return _mini;
+    }
 
     Vector3 TixyTaxyTorxyCoordinate::get3dcoordinate()
Index: /code/branches/TixyTaxyTorxy_HS18/src/modules/TixyTaxyTorxy/TixyTaxyTorxyCoordinate.h
===================================================================
--- /code/branches/TixyTaxyTorxy_HS18/src/modules/TixyTaxyTorxy/TixyTaxyTorxyCoordinate.h	(revision 12148)
+++ /code/branches/TixyTaxyTorxy_HS18/src/modules/TixyTaxyTorxy/TixyTaxyTorxyCoordinate.h	(revision 12149)
@@ -21,4 +21,5 @@
             virtual int GetX();
             virtual int GetY();
+            virtual int Getmini();
             virtual Vector3 get3dcoordinate();
 
@@ -26,4 +27,5 @@
             int _x;
             int _y;
+            int _mini;
     };
 
Index: /code/branches/TixyTaxyTorxy_HS18/src/modules/TixyTaxyTorxy/TixyTaxyTorxyField.cc
===================================================================
--- /code/branches/TixyTaxyTorxy_HS18/src/modules/TixyTaxyTorxy/TixyTaxyTorxyField.cc	(revision 12148)
+++ /code/branches/TixyTaxyTorxy_HS18/src/modules/TixyTaxyTorxy/TixyTaxyTorxyField.cc	(revision 12149)
@@ -38,4 +38,7 @@
 #include "core/XMLPort.h"
 #include "TixyTaxyTorxy.h"
+#include <iostream>
+
+using namespace std;
 
 namespace orxonox
@@ -85,5 +88,4 @@
         center_ = center;
     }
-
     // void TixyTaxyTorxyField::upgrade()
     // {
@@ -184,4 +186,5 @@
     }
 
+
     int TixyTaxyTorxyField::getAngle()
     {
@@ -256,11 +259,13 @@
     void TixyTaxyTorxyField::createTower(int upgrade)
     {        
-        counter++;
+        
         if (tower_ == nullptr)
         {
+            counter++;
             if(counter%2==0){
             modelGround_->setMeshSource("TD_T1.mesh");
             tower_ = new TixyTaxyTorxyTower(center_->getContext());
             attach(tower_);
+            type_ = TixyTaxyTorxyFieldType::TOWER1;
 
             }else{
@@ -268,37 +273,7 @@
             tower_ = new TixyTaxyTorxyTower(center_->getContext());
             attach(tower_);
-        }
-
-
-            // type_ = TixyTaxyTorxyFieldType::TOWER;
-            // setUpgrade(upgrade);
-            // if (upgrade_ > 0 && modelObject_ != nullptr)
-            // {
-            //     modelObject_->setMeshSource("TD_T2.mesh");                    
-            //     tower_->addTemplate(center_->getTower1Template());
-            //     switch (counter%2 +1)
-            //     {
-            //         case 1:
-            //             modelObject_->setMeshSource("TD_T1.mesh");                    
-            //             tower_->addTemplate(center_->getTower1Template());
-            //             break;
-            //         case 2:
-            //             modelObject_->setMeshSource("TD_T2.mesh");
-            //             tower_->addTemplate(center_->getTower2Template());
-            //             break;
-            //         case 3:
-            //             modelObject_->setMeshSource("TD_T3.mesh");
-            //             tower_->addTemplate(center_->getTower3Template());
-            //             break;
-            //         case 4:
-            //             modelObject_->setMeshSource("TD_T4.mesh");
-            //             tower_->addTemplate(center_->getTower4Template());
-            //             break;
-            //         case 5:
-            //             modelObject_->setMeshSource("TD_T5.mesh");
-            //             tower_->addTemplate(center_->getTower5Template());
-            //             break;
-            //     }
-            // }
+            type_ = TixyTaxyTorxyFieldType::TOWER2;  
+        }
+
         }                           
     }
Index: /code/branches/TixyTaxyTorxy_HS18/src/modules/TixyTaxyTorxy/TixyTaxyTorxyField.h
===================================================================
--- /code/branches/TixyTaxyTorxy_HS18/src/modules/TixyTaxyTorxy/TixyTaxyTorxyField.h	(revision 12148)
+++ /code/branches/TixyTaxyTorxy_HS18/src/modules/TixyTaxyTorxy/TixyTaxyTorxyField.h	(revision 12149)
@@ -48,4 +48,6 @@
         END,
         OBSTACLE,
+        TOWER1,
+        TOWER2,
         TOWER
     };
@@ -66,4 +68,8 @@
             const bool isFree() const
                 { return type_==TixyTaxyTorxyFieldType::FREE; }
+            const bool isTower1() const
+                { return type_==TixyTaxyTorxyFieldType::TOWER1; }    
+            const bool isTower2() const
+                { return type_==TixyTaxyTorxyFieldType::TOWER2; }
             virtual void create(char object, char param);
             virtual void setCenterpoint(TixyTaxyTorxyCenterpoint* center);
@@ -81,6 +87,7 @@
             virtual void createObstacle(int orientation);
             virtual void createTower(int upgrade);
-            virtual int getAngle();            
+            virtual int getAngle();          
         private:
+
             virtual void setAngle(int newAngle);            
             virtual void destroyTower();
Index: /code/branches/TixyTaxyTorxy_HS18/src/modules/TixyTaxyTorxy/TixyTaxyTorxyHUDController.cc
===================================================================
--- /code/branches/TixyTaxyTorxy_HS18/src/modules/TixyTaxyTorxy/TixyTaxyTorxyHUDController.cc	(revision 12148)
+++ /code/branches/TixyTaxyTorxy_HS18/src/modules/TixyTaxyTorxy/TixyTaxyTorxyHUDController.cc	(revision 12149)
@@ -31,4 +31,5 @@
 #include "core/XMLPort.h"
 #include "util/Convert.h"
+#include "TixyTaxyTorxy.h"
 
 namespace orxonox
Index: /code/branches/TixyTaxyTorxy_HS18/src/modules/TixyTaxyTorxy/TixyTaxyTorxySelecter.cc
===================================================================
--- /code/branches/TixyTaxyTorxy_HS18/src/modules/TixyTaxyTorxy/TixyTaxyTorxySelecter.cc	(revision 12148)
+++ /code/branches/TixyTaxyTorxy_HS18/src/modules/TixyTaxyTorxy/TixyTaxyTorxySelecter.cc	(revision 12149)
@@ -53,5 +53,5 @@
         boostPressed_ = false;
         buildTower_ = false;
-        setSelectedPosition(0,0);     
+        setSelectedPosition(5,5);     
     }
 
