Index: code/branches/minigame4DHS14/data/levels/4Dtest.oxw
===================================================================
--- code/branches/minigame4DHS14/data/levels/4Dtest.oxw	(revision 10104)
+++ code/branches/minigame4DHS14/data/levels/4Dtest.oxw	(revision 10115)
@@ -49,5 +49,5 @@
     
     
-    <SpawnPoint position="-200,200,100" lookat="0,0,0" />
+    <SpawnPoint position="-330,330,165" lookat="0,0,0" />
 
 	<Mini4DgameCenterpoint name=mini4Dgamecenter width=16 height=16 length=16 position="0,0,0">
@@ -55,15 +55,18 @@
         	<?lua
         	for i = -90, 90, 60
+        	do
         	?>
         		<?lua
         		for j = -90, 90, 60
+        		do
         		?>
         			<?lua
         			for k = -90, 90, 60
+        			do
         			?>
         				<Model
         				position="<?lua print(i) ?>,<?lua print(j) ?>,<?lua print(k) ?>"
-        				mesh="ast1.mesh"
-        				scale="1" />
+        				mesh="checkPoint.mesh"
+        				scale="5" />
         			<?lua
     		  		end
Index: code/branches/minigame4DHS14/src/modules/mini4Dgame/Mini4Dgame.h
===================================================================
--- code/branches/minigame4DHS14/src/modules/mini4Dgame/Mini4Dgame.h	(revision 10104)
+++ code/branches/minigame4DHS14/src/modules/mini4Dgame/Mini4Dgame.h	(revision 10115)
@@ -40,4 +40,22 @@
 namespace orxonox
 {
+	namespace mini4DgamePlayerColor
+	{
+		enum color
+		{
+			none,
+			red,
+			blue,
+			green
+		};
+	}
+
+	struct Mini4DgamePlayer
+	{
+	    Player player;
+	    mini4DgamePlayerColor::color color_;
+	};
+
+
     /**
     @brief
@@ -73,5 +91,5 @@
             void cleanup(void); //!< Cleans up the Gametype by destroying the ball and the bats.
 
-          Player players[3];
+          Mini4DgamePlayer players[2];
 
             WeakPtr<Mini4DgameCenterpoint> center_; //!< The playing field.
Index: code/branches/minigame4DHS14/src/modules/mini4Dgame/Mini4DgameCenterpoint.cc
===================================================================
--- code/branches/minigame4DHS14/src/modules/mini4Dgame/Mini4DgameCenterpoint.cc	(revision 10104)
+++ code/branches/minigame4DHS14/src/modules/mini4Dgame/Mini4DgameCenterpoint.cc	(revision 10115)
@@ -54,4 +54,14 @@
         this->height_ = 200;
         this->length_ = 200;
+
+        for(int i=0;i<4;i++){
+        	for(int j=0;j<4;j++){
+        		for(int k=0;k<4;k++){
+        			for(int l=0;l<4;l++){
+        				this->board[i][j][k][l]=mini4DgamePlayerColor::none;
+        			}
+        		}
+        	}
+        }
 
         this->checkGametype();
@@ -93,3 +103,297 @@
         }
     }
+
+    /**
+        @brief checks if the move is valid
+        @param the position where to put the stone plus the player who makes the move
+    */
+    bool Mini4DgameCenterpoint::isValidMove(const Vector4 move)
+    {
+    	return (this->board[(int)move.x][(int)move.y][(int)move.z][(int)move.w] == mini4DgamePlayerColor::none);
+    }
+
+    /**
+    @brief makes a move on the logic playboard
+    @param the position where to put the stone plus the player who makes the move
+    */
+    void Mini4DgameCenterpoint::makeMove(const Vector4 move, const mini4DgamePlayerColor::color playerColor)
+    {
+    	if(this->isValidMove(move))
+    	{
+    		this->board[(int)move.x][(int)move.y][(int)move.z][(int)move.w] = playerColor;
+    		mini4DgamePlayerColor::color winner = this->getWinner();
+    		if(winner != mini4DgamePlayerColor::none)
+    		{
+    			Mini4Dgame->win(winner);
+    		}
+    	}
+    }
+
+    mini4DgamePlayerColor::color Mini4DgameCenterpoint::getWinner()
+    {
+    	//check diagonals rows-columns-height-numbers
+		for(int i=1; i<4; i++)
+		{
+			if(this->board[i][i][i][i]==mini4DgamePlayerColor::none || this->board[0][0][0][0] != this->board[i][i][i][i])
+				break;
+			if(i==3)
+				return this->board[0][0][0][0];
+		}
+		for(int i=1; i<4; i++)
+		{
+			if(this->board[3-i][i][i][i]==mini4DgamePlayerColor::none || this->board[3][0][0][0] != this->board[3-i][i][i][i])
+				break;
+			if(i==3)
+				return this->board[3][0][0][0];
+		}
+		for(int i=1; i<4; i++)
+		{
+			if(this->board[i][3-i][i][i]==mini4DgamePlayerColor::none || this->board[0][3][0][0] != this->board[i][3-i][i][i])
+				break;
+			if(i==3)
+				return this->board[0][3][0][0];
+		}
+		for(int i=1; i<4; i++)
+		{
+			if(this->board[i][i][3-i][i]==mini4DgamePlayerColor::none || this->board[0][0][3][0] != this->board[i][i][3-i][i])
+				break;
+			if(i==3)
+				return this->board[0][0][3][0];
+		}
+		for(int i=1; i<4; i++)
+		{
+			if(this->board[i][i][i][3-i]==mini4DgamePlayerColor::none || this->board[0][0][0][3] != this->board[i][i][i][3-i])
+				break;
+			if(i==3)
+				return this->board[0][0][0][3];
+		}
+		for(int i=1; i<4; i++)
+		{
+			if(this->board[3-i][3-i][i][i]==mini4DgamePlayerColor::none || this->board[3][3][0][0] != this->board[3-i][3-i][i][i])
+				break;
+			if(i==3)
+				return this->board[3][3][0][0];
+		}
+		for(int i=1; i<4; i++)
+		{
+			if(this->board[3-i][i][3-i][i]==mini4DgamePlayerColor::none || this->board[3][0][3][0] != this->board[3-i][i][3-i][i])
+				break;
+			if(i==3)
+				return this->board[3][0][3][0];
+		}
+		for(int i=1; i<4; i++)
+		{
+			if(this->board[3-i][i][i][3-i]==mini4DgamePlayerColor::none || this->board[3][0][0][3] != this->board[3-i][i][i][3-i])
+				break;
+			if(i==3)
+				return this->board[3][0][0][3];
+		}
+
+		//check diagonals rows-columns-height
+		for(int l=0; l<4; l++)
+		{
+			for(int i=1; i<4; i++)
+			{
+				if(this->board[i][i][i][l]==mini4DgamePlayerColor::none || this->board[0][0][0][l] != this->board[i][i][i][l])
+					break;
+				if(i==3)
+					return this->board[0][0][0][l];
+			}
+			for(int i=1; i<4; i++)
+			{
+				if(this->board[3-i][i][i][l]==mini4DgamePlayerColor::none || this->board[3][0][0][l] != this->board[3-i][i][i][l])
+					break;
+				if(i==3)
+					return this->board[3][0][0][l];
+			}
+			for(int i=1; i<4; i++)
+			{
+				if(this->board[i][3-i][i][l]==mini4DgamePlayerColor::none || this->board[0][3][0][l] != this->board[i][3-i][i][l])
+					break;
+				if(i==3)
+					return this->board[0][3][0][l];
+			}
+			for(int i=1; i<4; i++)
+			{
+				if(this->board[i][i][3-i][l]==mini4DgamePlayerColor::none || this->board[0][0][3][l] != this->board[i][i][3-i][l])
+					break;
+				if(i==3)
+					return this->board[0][0][3][l];
+			}
+		}
+
+		//check diagonals rows-columns-numbers
+		for(int l=0; l<4; l++)
+		{
+			for(int i=1; i<4; i++)
+			{
+				if(this->board[i][i][l][i]==mini4DgamePlayerColor::none || this->board[0][0][l][0] != this->board[i][i][l][i])
+					break;
+				if(i==3)
+					return this->board[0][0][l][0];
+			}
+			for(int i=1; i<4; i++)
+			{
+				if(this->board[3-i][i][l][i]==mini4DgamePlayerColor::none || this->board[3][0][l][0] != this->board[3-i][i][l][i])
+					break;
+				if(i==3)
+					return this->board[3][0][l][0];
+			}
+			for(int i=1; i<4; i++)
+			{
+				if(this->board[i][3-i][l][i]==mini4DgamePlayerColor::none || this->board[0][3][l][0] != this->board[i][3-i][l][i])
+					break;
+				if(i==3)
+					return this->board[0][3][l][0];
+			}
+			for(int i=1; i<4; i++)
+			{
+				if(this->board[i][i][l][3-i]==mini4DgamePlayerColor::none || this->board[0][0][l][3] != this->board[i][i][l][3-i])
+					break;
+				if(i==3)
+					return this->board[0][0][l][3];
+			}
+		}
+
+		//check diagonals rows-height-numbers
+		for(int l=0; l<4; l++)
+		{
+			for(int i=1; i<4; i++)
+			{
+				if(this->board[i][l][i][i]==mini4DgamePlayerColor::none || this->board[0][l][0][0] != this->board[i][l][i][i])
+					break;
+				if(i==3)
+					return this->board[0][l][0][0];
+			}
+			for(int i=1; i<4; i++)
+			{
+				if(this->board[3-i][l][i][i]==mini4DgamePlayerColor::none || this->board[3][l][0][0] != this->board[3-i][l][i][i])
+					break;
+				if(i==3)
+					return this->board[3][l][0][0];
+			}
+			for(int i=1; i<4; i++)
+			{
+				if(this->board[i][l][3-i][i]==mini4DgamePlayerColor::none || this->board[0][l][3][0] != this->board[i][l][3-i][i])
+					break;
+				if(i==3)
+					return this->board[0][l][3][0];
+			}
+			for(int i=1; i<4; i++)
+			{
+				if(this->board[i][l][i][3-i]==mini4DgamePlayerColor::none || this->board[0][l][0][3] != this->board[i][l][i][3-i])
+					break;
+				if(i==3)
+					return this->board[0][l][0][3];
+			}
+		}
+
+		//check diagonals columns-height-numbers
+		for(int l=0; l<4; l++)
+		{
+			for(int i=1; i<4; i++)
+			{
+				if(this->board[l][i][i][i]==mini4DgamePlayerColor::none || this->board[l][0][0][0] != this->board[l][i][i][i])
+					break;
+				if(i==3)
+					return this->board[l][0][0][0];
+			}
+			for(int i=1; i<4; i++)
+			{
+				if(this->board[l][3-i][i][i]==mini4DgamePlayerColor::none || this->board[l][3][0][0] != this->board[l][3-i][i][i])
+					break;
+				if(i==3)
+					return this->board[l][3][0][0];
+			}
+			for(int i=1; i<4; i++)
+			{
+				if(this->board[l][i][3-i][i]==mini4DgamePlayerColor::none || this->board[l][0][3][0] != this->board[l][i][3-i][i])
+					break;
+				if(i==3)
+					return this->board[l][0][3][0];
+			}
+			for(int i=1; i<4; i++)
+			{
+				if(this->board[l][i][i][3-i]==mini4DgamePlayerColor::none || this->board[l][0][0][3] != this->board[l][i][i][3-i])
+					break;
+				if(i==3)
+					return this->board[l][0][0][3];
+			}
+		}
+
+		//check diagonals rows-columns
+		for(int k=0;k<4;k++){
+    		for(int l=0;l<4;l++){
+    			for(int i=1; i<4; i++)
+				{
+					if(this->board[i][i][k][l]==mini4DgamePlayerColor::none || this->board[0][0][l][0] != this->board[i][i][l][i])
+						break;
+					if(i==3)
+						return this->board[0][0][l][0];
+				}}}
+    	//-------------------------------------------------------------------------------------------------------
+
+    	//check rows
+    	for(int j=0;j<4;j++){
+    		for(int k=0;k<4;k++){
+    			for(int l=0;l<4;l++){
+    				if(this->board[0][j][k][l]!= mini4DgamePlayerColor::none
+    				   && this->board[0][j][k][l]==this->board[1][j][k][l]
+    				   && this->board[1][j][k][l]==this->board[2][j][k][l]
+    				   && this->board[2][j][k][l]==this->board[3][j][k][l])
+    				{
+    					return this->board[0][j][k][l];
+    				}
+    			}
+    		}
+    	}
+
+    	//check columns
+    	for(int i=0;i<4;i++){
+    		for(int k=0;k<4;k++){
+    			for(int l=0;l<4;l++){
+    				if(this->board[i][0][k][l]!= mini4DgamePlayerColor::none
+    	    				   && this->board[i][0][k][l]==this->board[i][1][k][l]
+    	    				   && this->board[i][1][k][l]==this->board[i][2][k][l]
+    	    				   && this->board[i][2][k][l]==this->board[i][3][k][l])
+    				{
+    	    			return this->board[i][0][k][l];
+    				}
+    			}
+    		}
+    	}
+
+    	//check height
+    	for(int i=0;i<4;i++){
+    		for(int j=0;j<4;j++){
+    			for(int l=0;l<4;l++){
+    				if(this->board[i][j][0][l]!= mini4DgamePlayerColor::none
+    	    	    				   && this->board[i][j][0][l]==this->board[i][j][1][l]
+    	    	    				   && this->board[i][j][1][l]==this->board[i][j][2][l]
+    	    	    				   && this->board[i][j][2][l]==this->board[i][j][3][l])
+    				{
+    					return this->board[i][j][0][l];
+    				}
+    			}
+    		}
+    	}
+
+    	//check numbers
+    	for(int i=0;i<4;i++){
+    		for(int j=0;j<4;j++){
+    			for(int k=0;k<4;k++){
+    				if(this->board[i][j][k][0]!= mini4DgamePlayerColor::none
+    	    	    				   && this->board[i][j][k][0]==this->board[i][j][k][1]
+    	    	    				   && this->board[i][j][k][1]==this->board[i][j][k][2]
+    	    	    				   && this->board[i][j][k][2]==this->board[i][j][k][3])
+    				{
+    					return this->board[i][j][k][0];
+    				}
+    			}
+    		}
+    	}
+
+
+    	return mini4DgamePlayerColor::none;
+    }
 }
Index: code/branches/minigame4DHS14/src/modules/mini4Dgame/Mini4DgameCenterpoint.h
===================================================================
--- code/branches/minigame4DHS14/src/modules/mini4Dgame/Mini4DgameCenterpoint.h	(revision 10104)
+++ code/branches/minigame4DHS14/src/modules/mini4Dgame/Mini4DgameCenterpoint.h	(revision 10115)
@@ -105,4 +105,21 @@
                 { return Vector3(this->width_, this->height_, this->length_); }
 
+            /**
+                    @brief checks if the move is valid
+                    @param the position where to put the stone plus the player who makes the move
+            */
+            bool isValidMove(const Vector4 move,const int playerColor);
+
+            /**
+               @brief makes a move on the logic playboard
+           	   @param the position where to put the stone plus the player who makes the move
+             */
+            void makeMove(const Vector4 move, const int player);
+
+            /**
+                @brief searches the board if somebody has won
+				@return the winner if somebody has won or mini4DgamePlayerColor::none if nobody has won so far
+             */
+            mini4DgamePlayerColor::color Mini4DgameCenterpoint::getWinner()
 
         private:
@@ -115,4 +132,5 @@
             float height_; //!< The width of the playing field.
             float length_; //!< The length of the playing field.
+            mini4DgamePlayerColor::color board[4][4][4][4]; //!< The logical board where the game takes place. board[row][column][height][number]
     };
 }
