Index: code/branches/minigame4DHS14/src/modules/mini4dgame/CMakeLists.txt
===================================================================
--- code/branches/minigame4DHS14/src/modules/mini4dgame/CMakeLists.txt	(revision 10226)
+++ code/branches/minigame4DHS14/src/modules/mini4dgame/CMakeLists.txt	(revision 10226)
@@ -0,0 +1,14 @@
+SET_SOURCE_FILES(Mini4Dgame_SRC_FILES
+  Mini4Dgame.cc
+  #Mini4DgameAI.cc
+  Mini4DgameBoard.cc
+)
+
+ORXONOX_ADD_LIBRARY(mini4Dgame
+  MODULE
+  FIND_HEADER_FILES
+  LINK_LIBRARIES
+    orxonox
+    overlays
+  SOURCE_FILES ${Mini4Dgame_SRC_FILES}
+)
Index: code/branches/minigame4DHS14/src/modules/mini4dgame/Mini4Dgame.cc
===================================================================
--- code/branches/minigame4DHS14/src/modules/mini4dgame/Mini4Dgame.cc	(revision 10226)
+++ code/branches/minigame4DHS14/src/modules/mini4dgame/Mini4Dgame.cc	(revision 10226)
@@ -0,0 +1,201 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      ...
+ *   Co-authors:
+ *      Johannes Ritz
+ *
+ *
+ *
+ *
+ *TASK c) end the game in a nicer way
+ *TASK d) save the highscore
+ *TASK e) eye candy
+ */
+
+/**
+    @file Tetris.cc
+    @brief Implementation of the Mini4Dgame class.
+*/
+
+#include "Mini4Dgame.h"
+
+#include "core/CoreIncludes.h"
+#include "core/EventIncludes.h"
+#include "core/command/Executor.h"
+#include "core/config/ConfigValueIncludes.h"
+#include "infos/PlayerInfo.h"
+#include "core/command/ConsoleCommand.h"
+
+#include "gamestates/GSLevel.h"
+#include "chat/ChatManager.h"
+
+namespace orxonox
+{
+
+	SetConsoleCommand("Mini4Dgame", "setStone", &Mini4Dgame::setStone).addShortcut();
+	SetConsoleCommand("Mini4Dgame", "undoStone", &Mini4Dgame::undoStone).addShortcut();
+
+    RegisterUnloadableClass(Mini4Dgame);
+
+    /**
+    @brief
+        Constructor. Registers and initializes the object.
+    */
+    Mini4Dgame::Mini4Dgame(Context* context) : Deathmatch(context)
+    {
+        RegisterObject(Mini4Dgame);
+
+        this->board_ = 0;
+
+        // Set the type of Bots for this particular Gametype.
+        //this->botclass_ = Class(Mini4DgameBot);
+    }
+
+    /**
+    @brief
+        Destructor. Cleans up, if initialized.
+    */
+    Mini4Dgame::~Mini4Dgame()
+    {
+        if (this->isInitialized())
+            this->cleanup();
+    }
+
+    /**
+    @brief
+        Cleans up the Gametype.
+    */
+    void Mini4Dgame::cleanup()
+    {
+    	if(this->board_ != NULL)// Destroy the board, if present.
+    	{
+    		//this->board_->destroy();
+    		this->board_ = 0;
+    	}
+    }
+
+    /**
+    @brief
+        Starts the mini4Dgame.
+    */
+    void Mini4Dgame::start()
+    {
+        if (this->board_ != NULL) // There needs to be a Mini4DgameCenterpoint, i.e. the area the game takes place.
+        {
+        	/*
+        	if (this->board_ == NULL)
+        	{
+        		this->board_ = new Mini4DgameBoard(this->board_->getContext());
+        		// Apply the template for the ball specified by the centerpoint.
+        		this->board_->addTemplate(this->center_->getBoardtemplate());
+        	}
+        	*/
+
+        	// Attach the board to the centerpoint and set the parameters as specified in the centerpoint, the ball is attached to.
+
+        	this->board_->setPosition(0, 0, 0);
+
+        }
+        else // If no centerpoint was specified, an error is thrown and the level is exited.
+        {
+            orxout(internal_error) << "Mini4Dgame: No Centerpoint specified." << endl;
+            GSLevel::startMainMenu();
+            return;
+        }
+
+        // Set variable to temporarily force the player to spawn.
+        bool temp = this->bForceSpawn_;
+        this->bForceSpawn_ = true;
+
+        // Call start for the parent class.
+        Deathmatch::start();
+
+        // Reset the variable.
+        this->bForceSpawn_ = temp;
+    }
+
+    /**
+    @brief
+        Ends the Mini4Dgame minigame.
+    */
+    void Mini4Dgame::end()
+    {
+    	this->cleanup();
+
+        // Call end for the parent class.
+        Deathmatch::end();
+    }
+
+
+    /**
+    @brief
+        Spawns player.
+    */
+    void Mini4Dgame::spawnPlayersIfRequested()
+    {
+        // first spawn human players to assign always the left bat to the player in singleplayer
+        for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
+            if (it->first->isHumanPlayer() && (it->first->isReadyToSpawn() || this->bForceSpawn_))
+                this->spawnPlayer(it->first);
+        // now spawn bots
+        for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
+            if (!it->first->isHumanPlayer() && (it->first->isReadyToSpawn() || this->bForceSpawn_))
+                this->spawnPlayer(it->first);
+    }
+
+    /**
+    @brief
+        Spawns the input player.
+    @param player
+        The player to be spawned.
+    */
+    void Mini4Dgame::spawnPlayer(PlayerInfo* player)
+    {
+        assert(player);
+
+        if(false)//this->player_ == NULL)
+        {
+            //this->player_ = player;
+            this->players_[player].state_ = PlayerState::Alive;
+        }
+    }
+
+    void Mini4Dgame::undoStone()//Vector4 move, const int playerColor)
+    {
+    	ObjectList<Mini4DgameBoard>::iterator it = ObjectList<Mini4DgameBoard>::begin();
+        it->undoMove();
+    }
+
+    //void Mini4Dgame::setStone(Vector4 move, const int playerColor, Mini4DgameBoard* board)
+    void Mini4Dgame::setStone(int x,int y,int z,int w)//Vector4 move, const int playerColor)
+    {
+    	Vector4 move = Vector4(x,y,z,w);
+        ObjectList<Mini4DgameBoard>::iterator it = ObjectList<Mini4DgameBoard>::begin();
+        it->makeMove(move);
+    }
+
+    void Mini4Dgame::win(Mini4DgameWinner winner)
+    {
+
+    }
+}
Index: code/branches/minigame4DHS14/src/modules/mini4dgame/Mini4Dgame.h
===================================================================
--- code/branches/minigame4DHS14/src/modules/mini4dgame/Mini4Dgame.h	(revision 10226)
+++ code/branches/minigame4DHS14/src/modules/mini4dgame/Mini4Dgame.h	(revision 10226)
@@ -0,0 +1,97 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      ...
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file Mini4Dgame.h
+    @brief Declaration of the Mini4Dgame class.
+*/
+
+#ifndef _Mini4Dgame_H__
+#define _Mini4Dgame_H__
+
+#include "gametypes/Deathmatch.h"
+#include "mini4Dgame/Mini4DgamePrereqs.h"
+#include "Mini4DgameBoard.h"
+
+namespace orxonox
+{
+
+	namespace mini4DgamePlayerColor
+	{
+		enum color
+		{
+			none,
+			red,
+			blue,
+			green
+		};
+	}
+
+    /**
+    @brief
+
+    @author
+
+    */
+    class _Mini4DgameExport Mini4Dgame : public Deathmatch
+    {
+        public:
+    		Mini4Dgame(Context* context); //!< Constructor. Registers and initializes the object.
+            virtual ~Mini4Dgame(); //!< Destructor. Cleans up, if initialized.
+
+            virtual void start(void); //!< Starts the Mini4Dgame minigame.
+            virtual void end(void); ///!< Ends the Mini4Dgame minigame.
+
+            virtual void spawnPlayer(PlayerInfo* player); //!< Spawns the input player.
+
+            void setGameboard(Mini4DgameBoard* board)
+            	{ this->board_ = board; }
+
+            Mini4DgameBoard* getBoard(void)
+            	{ return this->board_; }
+
+            static void undoStone();
+
+            //static void setStone(Vector4 move, const int playerColor, Mini4DgameBoard* board);
+            static void setStone(int x,int y, int z, int w);//Vector4 move, const int playerColor);
+
+            void win(Mini4DgameWinner winner);
+
+        protected:
+            virtual void spawnPlayersIfRequested(); //!< Spawns player.
+
+
+        private:
+            void cleanup(void); //!< Cleans up the Gametype by destroying the ball and the bats.
+
+            //Player players[2];
+            Mini4DgameBoard* board_;
+    };
+}
+
+#endif /* _Mini4Dgame_H__ */
Index: code/branches/minigame4DHS14/src/modules/mini4dgame/Mini4DgameAI.cc
===================================================================
--- code/branches/minigame4DHS14/src/modules/mini4dgame/Mini4DgameAI.cc	(revision 10226)
+++ code/branches/minigame4DHS14/src/modules/mini4dgame/Mini4DgameAI.cc	(revision 10226)
@@ -0,0 +1,126 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file Mini4DgameAI.cc
+    @brief Implementation of the Mini4DgameAI class.
+*/
+
+#include "Mini4DgameAI.h"
+
+#include "core/CoreIncludes.h"
+#include "core/config/ConfigValueIncludes.h"
+#include "core/command/Executor.h"
+#include "tools/Timer.h"
+
+#include <list>
+
+#include "worldentities/ControllableEntity.h"
+
+#include "Mini4DgameCenterpoint.h"
+
+namespace orxonox
+{
+    RegisterUnloadableClass(Mini4DgameAI);
+
+    //const static float MAX_REACTION_TIME = 0.4f;
+
+    /**
+    @brief
+        Constructor. Registers and initializes the object.
+    */
+    Mini4DgameAI::Mini4DgameAI(Context* context) : Controller(context)
+    {
+        RegisterObject(Mini4DgameAI);
+
+        this->setConfigValues();
+        this->center_ = 0;
+    }
+
+    /**
+    @brief
+        Destructor. Cleans up the list fo reaction timers.
+    */
+    Mini4DgameAI::~Mini4DgameAI()
+    {
+
+    }
+
+    Vector4 Mini4DgameAI::makeMove(float timeout)
+    {
+    	this->copyBoard();
+    	std::list<Vector4> possibleMoves = this->getPossibleMoves();
+
+    	//TODO: alphabeta ueber possibleMoves
+
+    	//when timeout
+    	Vector4 move = possibleMoves.front();
+    	return move;
+    }
+
+    void Mini4DgameAI::copyBoard()
+    {
+		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]=this->center_->board[i][j][k][l];
+					}
+				}
+			}
+		}
+    }
+
+    std::list<Vector4> Mini4DgameAI::getPossibleMoves()
+    {
+    	std::list<Vector4> possibleMoves = new std::list<Vector4>;
+    	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++){
+						if (this->board_[i][j][k][l]==mini4DgamePlayerColor::none)
+							possibleMoves.push_back(Vector4(i,j,k,l));
+					}
+				}
+			}
+		}
+    	return possibleMoves;
+    }
+
+    /**
+    @brief
+        Is called each tick.
+        Implements the behavior of the PongAI (i.e. its intelligence).
+    @param dt
+        The time that has elapsed since the last tick.
+    */
+    void Mini4DgameAI::tick(float dt)
+    {
+
+    }
+}
Index: code/branches/minigame4DHS14/src/modules/mini4dgame/Mini4DgameAI.h
===================================================================
--- code/branches/minigame4DHS14/src/modules/mini4dgame/Mini4DgameAI.h	(revision 10226)
+++ code/branches/minigame4DHS14/src/modules/mini4dgame/Mini4DgameAI.h	(revision 10226)
@@ -0,0 +1,94 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file Mini4DgameAI.h
+    @brief Declaration of the Mini4DgameAI class.
+*/
+
+#ifndef _Mini4DgameAI_H__
+#define _Mini4DgameAI_H__
+
+#include "mini4Dgame/Mini4DgamePrereqs.h"
+
+#include <list>
+
+#include "tools/interfaces/Tickable.h"
+
+#include "controllers/Controller.h"
+#include "Mini4DgameCenterpoint.h"
+#include "Mini4Dgame.h"
+
+namespace orxonox
+{
+
+    /**
+    @brief
+        The Mini4DgameAI is an artificial intelligence for the @ref orxonox::Mini4Dgame "Mini4Dgame" gametype.
+
+    @author
+        Oliver Richter
+    */
+    class _Mini4DgameExport Mini4DgameAI : public Controller, public Tickable
+    {
+        public:
+    		Mini4DgameAI(Context* context); //!< Constructor. Registers and initializes the object.
+            virtual ~Mini4DgameAI();
+
+            //void setConfigValues();
+
+            /**
+                @brief
+                    starts the AI to make a move. implements the intelligence of the AI
+                @param timeout
+                    The time the AI has to decide on a move. (Sets the strength of the AI)
+                @return move
+                	The move that the AI decided to make.
+            */
+            Vector4 makeMove(float timeout);
+
+
+            virtual void tick(float dt);
+
+            void setCenterpoint(Mini4DgameCenterpoint* center)
+                        	{ this->center_ = center; }
+
+        protected:
+
+            std::list<std::pair<Timer*, char> > reactionTimers_; //!< A list of reaction timers and the directions that take effect when their timer expires.
+            Mini4DgameCenterpoint* center_;
+
+        private:
+
+            std::list<Vector4> getPossibleMoves();
+            void copyBoard();
+            mini4DgamePlayerColor::color board_[4][4][4][4];
+    };
+}
+
+#endif /* _Mini4DgameAI_H__ */
Index: code/branches/minigame4DHS14/src/modules/mini4dgame/Mini4DgameBoard.cc
===================================================================
--- code/branches/minigame4DHS14/src/modules/mini4dgame/Mini4DgameBoard.cc	(revision 10226)
+++ code/branches/minigame4DHS14/src/modules/mini4dgame/Mini4DgameBoard.cc	(revision 10226)
@@ -0,0 +1,925 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file PongBall.cc
+    @brief Implementation of the PongBall class.
+*/
+
+#include "Mini4DgameBoard.h"
+
+#include "core/CoreIncludes.h"
+#include "core/GameMode.h"
+
+#include "gametypes/Gametype.h"
+#include "graphics/BlinkingBillboard.h"
+
+#include "core/XMLPort.h"
+
+#include "Mini4Dgame.h"
+
+namespace orxonox
+{
+    RegisterClass(Mini4DgameBoard);
+
+    /**
+    @brief
+        Constructor. Registers and initializes the object.
+    */
+    Mini4DgameBoard::Mini4DgameBoard(Context* context) : StaticEntity(context)
+    {
+        RegisterObject(Mini4DgameBoard);
+
+        //this->registerVariables();
+
+        //initialize board
+        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->blinkingBillboards[i][j][k][l] = 0;
+        			}
+        		}
+        	}
+        }
+        this->player_toggle_ = false;
+        this->checkGametype();
+    }
+
+
+    //xml port for loading sounds
+    void Mini4DgameBoard::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(Mini4DgameBoard, XMLPort, xmlelement, mode);
+    }
+
+	/**
+        @brief checks if the move is valid
+        @param the position where to put the stone plus the player who makes the move
+    */
+    bool Mini4DgameBoard::isValidMove(const Vector4 move)
+    {
+    	return (move.x<4 && move.y<4 && move.z<4 && move.w<4
+    			&& move.x>=0 && move.y>=0 && move.z>=0 && move.w>=0
+    			&& this->board[(int)move.x][(int)move.y][(int)move.z][(int)move.w] == mini4DgamePlayerColor::none);
+    }
+
+	void Mini4DgameBoard::undoMove()
+	{
+		Vector4 move = moves.back();
+		moves.pop_back();
+    	this->board[(int)move.x][(int)move.y][(int)move.z][(int)move.w] = mini4DgamePlayerColor::none;
+    	this->blinkingBillboards[(int)move.x][(int)move.y][(int)move.z][(int)move.w]->destroy();
+    	this->blinkingBillboards[(int)move.x][(int)move.y][(int)move.z][(int)move.w] = 0;
+    	if(player_toggle_){
+    		this->player_toggle_ = false;
+    	}else{
+    		this->player_toggle_ = true;
+    	}
+	}
+
+    /**
+    @brief makes a move on the logic playboard
+    @param the position where to put the stone plus the player who makes the move
+    */
+    void Mini4DgameBoard::makeMove(const Vector4 move)
+    {
+    	if(this->isValidMove(move))
+    	{
+    		if(!moves.empty())
+    		{
+    			//stop blinking of last move
+    			Vector4 lastMove = moves.back();
+    			this->blinkingBillboards[(int)lastMove.x][(int)lastMove.y][(int)lastMove.z][(int)lastMove.w]
+    					->setActive(false);
+    			this->blinkingBillboards[(int)lastMove.x][(int)lastMove.y][(int)lastMove.z][(int)lastMove.w]
+    					->setScale(0.1);
+    		}
+
+    		moves.push_back(move);
+    		mini4DgamePlayerColor::color playerColor = mini4DgamePlayerColor::none;
+    		if(player_toggle_){
+    			playerColor = mini4DgamePlayerColor::blue;
+    			this->player_toggle_ = false;
+    		}else{
+    			playerColor = mini4DgamePlayerColor::green;
+    			this->player_toggle_ = true;
+    		}
+
+    		this->board[(int)move.x][(int)move.y][(int)move.z][(int)move.w] = (mini4DgamePlayerColor::color) playerColor;
+
+    		BlinkingBillboard* bb = new BlinkingBillboard(this->getContext());
+			bb->setFrequency(0.3);
+			bb->setAmplitude(0.1);
+
+			switch((int)move.w){
+			case 0:	bb->setMaterial("Numbers/One");
+					bb->setPosition(60*(int)move.x-95,60*(int)move.y-95,60*(int)move.z-95);
+					break;
+			case 1:	bb->setMaterial("Numbers/Two");
+					bb->setPosition(60*(int)move.x-85,60*(int)move.y-85,60*(int)move.z-95);
+					break;
+			case 2:	bb->setMaterial("Numbers/Three");
+					bb->setPosition(60*(int)move.x-85,60*(int)move.y-95,60*(int)move.z-85);
+					break;
+			case 3:	bb->setMaterial("Numbers/Four");
+					bb->setPosition(60*(int)move.x-85,60*(int)move.y-85,60*(int)move.z-85);
+					break;
+			}
+
+			switch(playerColor){
+			case mini4DgamePlayerColor::red:
+				bb->setColour(ColourValue(1,0,0)); break;
+			case mini4DgamePlayerColor::green:
+				bb->setColour(ColourValue(0,1,0)); break;
+			case mini4DgamePlayerColor::blue:
+				bb->setColour(ColourValue(0,0,1)); break;
+			default:	break;
+			}
+
+			this->attach(bb);
+			this->blinkingBillboards[(int)move.x][(int)move.y][(int)move.z][(int)move.w] = bb;
+
+
+    		Mini4DgameWinner winner = this->getWinner();
+    		if(winner.color_ != mini4DgamePlayerColor::none)
+    		{
+    			orxout(user_status) << "Mini4Dgame: win!!!!!!!" << endl;
+    			for(int i=0;i<4;i++){
+    				BlinkingBillboard* redFlare = new BlinkingBillboard(this->getContext());
+					redFlare->setFrequency(0.5);
+					redFlare->setAmplitude(3);
+					redFlare->setPosition(60*(int)winner.winningRow[i]-90,
+									60*(int)winner.winningColumn[i]-90,
+									60*(int)winner.winningHeight[i]-90);
+					redFlare->setMaterial("Flares/lensflare");
+					redFlare->setColour(ColourValue(1,0,0));
+					this->attach(redFlare);
+					BlinkingBillboard* bb = this->blinkingBillboards[winner.winningRow[i]]
+																	[winner.winningColumn[i]]
+																	[winner.winningHeight[i]]
+																	[winner.winningNumber[i]];
+					bb->setActive(true);//start blinking
+				}
+    		}
+    	}else{
+			orxout(internal_error) << "Mini4Dgame: not a valid move"<< endl;
+    	}
+    }
+
+    Mini4DgameWinner Mini4DgameBoard::getWinner()
+    {
+    	Mini4DgameWinner winner;
+		winner.color_ = mini4DgamePlayerColor::none;
+
+    	//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)
+			{
+				winner.color_ = this->board[0][0][0][0];
+				for(int x=0; x<4; x++){
+					winner.winningRow[x] = x;
+					winner.winningColumn[x] = x;
+					winner.winningHeight[x] = x;
+					winner.winningNumber[x] = x;
+				}
+				return winner;
+			}
+		}
+		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)
+			{
+				winner.color_ = this->board[3][0][0][0];
+				for(int x=0; x<4; x++){
+					winner.winningRow[x] = 3-x;
+					winner.winningColumn[x] = x;
+					winner.winningHeight[x] = x;
+					winner.winningNumber[x] = x;
+				}
+				return winner;
+			}
+		}
+		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)
+			{
+				winner.color_ = this->board[0][3][0][0];
+				for(int x=0; x<4; x++){
+					winner.winningRow[x] = x;
+					winner.winningColumn[x] = 3-x;
+					winner.winningHeight[x] = x;
+					winner.winningNumber[x] = x;
+				}
+				return winner;
+			}
+		}
+		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)
+			{
+				winner.color_ = this->board[0][0][3][0];
+				for(int x=0; x<4; x++){
+					winner.winningRow[x] = x;
+					winner.winningColumn[x] = x;
+					winner.winningHeight[x] = 3-x;
+					winner.winningNumber[x] = x;
+				}
+				return winner;
+			}
+		}
+		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)
+			{
+				winner.color_ = this->board[0][0][0][3];
+				for(int x=0; x<4; x++){
+					winner.winningRow[x] = x;
+					winner.winningColumn[x] = x;
+					winner.winningHeight[x] = x;
+					winner.winningNumber[x] = 3-x;
+				}
+				return winner;
+			}
+		}
+		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)
+			{
+				winner.color_ = this->board[3][3][0][0];
+				for(int x=0; x<4; x++){
+					winner.winningRow[x] = 3-x;
+					winner.winningColumn[x] = 3-x;
+					winner.winningHeight[x] = x;
+					winner.winningNumber[x] = x;
+				}
+				return winner;
+			}
+		}
+		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)
+			{
+				winner.color_ = this->board[3][0][3][0];
+				for(int x=0; x<4; x++){
+					winner.winningRow[x] = 3-x;
+					winner.winningColumn[x] = x;
+					winner.winningHeight[x] = 3-x;
+					winner.winningNumber[x] = x;
+				}
+				return winner;
+			}
+		}
+		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)
+			{
+				winner.color_ = this->board[3][0][0][3];
+				for(int x=0; x<4; x++){
+					winner.winningRow[x] = 3-x;
+					winner.winningColumn[x] = x;
+					winner.winningHeight[x] = x;
+					winner.winningNumber[x] = 3-x;
+				}
+				return winner;
+			}
+		}
+
+		//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)
+				{
+					winner.color_ = this->board[0][0][0][l];
+					for(int x=0; x<4; x++){
+						winner.winningRow[x] = x;
+						winner.winningColumn[x] = x;
+						winner.winningHeight[x] = x;
+						winner.winningNumber[x] = l;
+					}
+					return winner;
+				}
+			}
+			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)
+				{
+					winner.color_ = this->board[3][0][0][l];
+					for(int x=0; x<4; x++){
+						winner.winningRow[x] = 3-x;
+						winner.winningColumn[x] = x;
+						winner.winningHeight[x] = x;
+						winner.winningNumber[x] = l;
+					}
+					return winner;
+				}
+			}
+			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)
+				{
+					winner.color_ = this->board[0][3][0][l];
+					for(int x=0; x<4; x++){
+						winner.winningRow[x] = x;
+						winner.winningColumn[x] = 3-x;
+						winner.winningHeight[x] = x;
+						winner.winningNumber[x] = l;
+					}
+					return winner;
+				}
+			}
+			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)
+				{
+					winner.color_ = this->board[0][0][3][l];
+					for(int x=0; x<4; x++){
+						winner.winningRow[x] = x;
+						winner.winningColumn[x] = x;
+						winner.winningHeight[x] = 3-x;
+						winner.winningNumber[x] = l;
+					}
+					return winner;
+				}
+			}
+		}
+
+		//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)
+				{
+					winner.color_ = this->board[0][0][l][0];
+					for(int x=0; x<4; x++){
+						winner.winningRow[x] = x;
+						winner.winningColumn[x] = x;
+						winner.winningHeight[x] = l;
+						winner.winningNumber[x] = x;
+					}
+					return winner;
+				}
+			}
+			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)
+				{
+					winner.color_ = this->board[3][0][l][0];
+					for(int x=0; x<4; x++){
+						winner.winningRow[x] = 3-x;
+						winner.winningColumn[x] = x;
+						winner.winningHeight[x] = l;
+						winner.winningNumber[x] = x;
+					}
+					return winner;
+				}
+			}
+			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)
+				{
+					winner.color_ = this->board[0][3][l][0];
+					for(int x=0; x<4; x++){
+						winner.winningRow[x] = x;
+						winner.winningColumn[x] = 3-x;
+						winner.winningHeight[x] = l;
+						winner.winningNumber[x] = x;
+					}
+					return winner;
+				}
+			}
+			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)
+				{
+					winner.color_ = this->board[0][0][l][3];
+					for(int x=0; x<4; x++){
+						winner.winningRow[x] = x;
+						winner.winningColumn[x] = x;
+						winner.winningHeight[x] = l;
+						winner.winningNumber[x] = 3-x;
+					}
+					return winner;
+				}
+			}
+		}
+
+		//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)
+				{
+					winner.color_ = this->board[0][l][0][0];
+					for(int x=0; x<4; x++){
+						winner.winningRow[x] = x;
+						winner.winningColumn[x] = l;
+						winner.winningHeight[x] = x;
+						winner.winningNumber[x] = x;
+					}
+					return winner;
+				}
+			}
+			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)
+				{
+					winner.color_ = this->board[3][l][0][0];
+					for(int x=0; x<4; x++){
+						winner.winningRow[x] = 3-x;
+						winner.winningColumn[x] = l;
+						winner.winningHeight[x] = x;
+						winner.winningNumber[x] = x;
+					}
+					return winner;
+				}
+			}
+			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)
+				{
+					winner.color_ = this->board[0][l][3][0];
+					for(int x=0; x<4; x++){
+						winner.winningRow[x] = x;
+						winner.winningColumn[x] = l;
+						winner.winningHeight[x] = 3-x;
+						winner.winningNumber[x] = x;
+					}
+					return winner;
+				}
+			}
+			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)
+				{
+					winner.color_ = this->board[0][l][0][3];
+					for(int x=0; x<4; x++){
+						winner.winningRow[x] = x;
+						winner.winningColumn[x] = l;
+						winner.winningHeight[x] = x;
+						winner.winningNumber[x] = 3-x;
+					}
+					return winner;
+				}
+			}
+		}
+
+		//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)
+				{
+					winner.color_ = this->board[l][0][0][0];
+					for(int x=0; x<4; x++){
+						winner.winningRow[x] = l;
+						winner.winningColumn[x] = x;
+						winner.winningHeight[x] = x;
+						winner.winningNumber[x] = x;
+					}
+					return winner;
+				}
+			}
+			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)
+				{
+					winner.color_ = this->board[l][3][0][0];
+					for(int x=0; x<4; x++){
+						winner.winningRow[x] = l;
+						winner.winningColumn[x] = 3-x;
+						winner.winningHeight[x] = x;
+						winner.winningNumber[x] = x;
+					}
+					return winner;
+				}
+			}
+			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)
+				{
+					winner.color_ = this->board[l][0][3][0];
+					for(int x=0; x<4; x++){
+						winner.winningRow[x] = l;
+						winner.winningColumn[x] = x;
+						winner.winningHeight[x] = 3-x;
+						winner.winningNumber[x] = x;
+					}
+					return winner;
+				}
+			}
+			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)
+				{
+					winner.color_ = this->board[l][0][0][3];
+					for(int x=0; x<4; x++){
+						winner.winningRow[x] = l;
+						winner.winningColumn[x] = x;
+						winner.winningHeight[x] = x;
+						winner.winningNumber[x] = 3-x;
+					}
+					return winner;
+				}
+			}
+		}
+
+		//check 2d diagonals
+		for(int k=0;k<4;k++){
+    		for(int l=0;l<4;l++){
+    			//rows-columns
+    			for(int i=1; i<4; i++)
+				{
+					if(this->board[i][i][k][l]==mini4DgamePlayerColor::none || this->board[0][0][k][l] != this->board[i][i][k][l])
+						break;
+					if(i==3)
+					{
+						winner.color_ = this->board[0][0][k][l];
+						for(int x=0; x<4; x++){
+							winner.winningRow[x] = x;
+							winner.winningColumn[x] = x;
+							winner.winningHeight[x] = k;
+							winner.winningNumber[x] = l;
+						}
+						return winner;
+					}
+				}
+				for(int i=1; i<4; i++)
+				{
+					if(this->board[3-i][i][k][l]==mini4DgamePlayerColor::none || this->board[3][0][k][l] != this->board[3-i][i][k][l])
+						break;
+					if(i==3)
+					{
+						winner.color_ = this->board[3][0][k][l];
+						for(int x=0; x<4; x++){
+							winner.winningRow[x] = 3-x;
+							winner.winningColumn[x] = x;
+							winner.winningHeight[x] = k;
+							winner.winningNumber[x] = l;
+						}
+						return winner;
+					}
+				}
+				//rows-height
+    			for(int i=1; i<4; i++)
+    			{
+    				if(this->board[i][k][i][l]==mini4DgamePlayerColor::none || this->board[0][k][0][l] != this->board[i][k][i][l])
+    					break;
+    				if(i==3)
+    				{
+						winner.color_ = this->board[0][k][0][l];
+						for(int x=0; x<4; x++){
+							winner.winningRow[x] = x;
+							winner.winningColumn[x] = k;
+							winner.winningHeight[x] = x;
+							winner.winningNumber[x] = l;
+						}
+						return winner;
+					}
+				}
+				for(int i=1; i<4; i++)
+    			{
+    				if(this->board[3-i][k][i][l]==mini4DgamePlayerColor::none || this->board[3][k][0][l] != this->board[3-i][k][i][l])
+    					break;
+    				if(i==3)
+    				{
+						winner.color_ = this->board[3][k][0][l];
+						for(int x=0; x<4; x++){
+							winner.winningRow[x] = 3-x;
+							winner.winningColumn[x] = k;
+							winner.winningHeight[x] = x;
+							winner.winningNumber[x] = l;
+						}
+						return winner;
+					}
+				}
+				//rows-numbers
+				for(int i=1; i<4; i++)
+    			{
+    				if(this->board[i][k][l][i]==mini4DgamePlayerColor::none || this->board[0][k][l][0] != this->board[i][k][l][i])
+    					break;
+    				if(i==3)
+    				{
+						winner.color_ = this->board[0][k][l][0];
+						for(int x=0; x<4; x++){
+							winner.winningRow[x] = x;
+							winner.winningColumn[x] = k;
+							winner.winningHeight[x] = l;
+							winner.winningNumber[x] = x;
+						}
+						return winner;
+					}
+				}
+				for(int i=1; i<4; i++)
+    			{
+    				if(this->board[3-i][k][l][i]==mini4DgamePlayerColor::none || this->board[3][k][l][0] != this->board[3-i][k][l][i])
+    					break;
+    				if(i==3)
+    				{
+						winner.color_ = this->board[3][k][l][0];
+						for(int x=0; x<4; x++){
+							winner.winningRow[x] = 3-x;
+							winner.winningColumn[x] = k;
+							winner.winningHeight[x] = l;
+							winner.winningNumber[x] = x;
+						}
+						return winner;
+					}
+				}
+				//column-height
+				for(int i=1; i<4; i++)
+    			{
+    				if(this->board[k][i][i][l]==mini4DgamePlayerColor::none || this->board[k][0][0][l] != this->board[k][i][i][l])
+    					break;
+    				if(i==3)
+    				{
+						winner.color_ = this->board[k][0][0][l];
+						for(int x=0; x<4; x++){
+							winner.winningRow[x] = k;
+							winner.winningColumn[x] = x;
+							winner.winningHeight[x] = x;
+							winner.winningNumber[x] = l;
+						}
+						return winner;
+					}
+				}
+				for(int i=1; i<4; i++)
+    			{
+    				if(this->board[k][3-i][i][l]==mini4DgamePlayerColor::none || this->board[k][3][0][l] != this->board[k][3-i][i][l])
+    					break;
+    				if(i==3)
+    				{
+						winner.color_ = this->board[k][3][0][l];
+						for(int x=0; x<4; x++){
+							winner.winningRow[x] = k;
+							winner.winningColumn[x] = 3-x;
+							winner.winningHeight[x] = x;
+							winner.winningNumber[x] = l;
+						}
+						return winner;
+					}
+				}
+				//column-numbers
+				for(int i=1; i<4; i++)
+    			{
+    				if(this->board[k][i][l][i]==mini4DgamePlayerColor::none || this->board[k][0][l][0] != this->board[k][i][l][i])
+    					break;
+    				if(i==3)
+    				{
+						winner.color_ = this->board[k][0][l][0];
+						for(int x=0; x<4; x++){
+							winner.winningRow[x] = k;
+							winner.winningColumn[x] = x;
+							winner.winningHeight[x] = l;
+							winner.winningNumber[x] = x;
+						}
+						return winner;
+					}
+				}
+				for(int i=1; i<4; i++)
+    			{
+    				if(this->board[k][3-i][l][i]==mini4DgamePlayerColor::none || this->board[k][3][l][0] != this->board[k][3-i][l][i])
+    					break;
+    				if(i==3)
+    				{
+						winner.color_ = this->board[k][3][l][0];
+						for(int x=0; x<4; x++){
+							winner.winningRow[x] = k;
+							winner.winningColumn[x] = 3-x;
+							winner.winningHeight[x] = l;
+							winner.winningNumber[x] = x;
+						}
+						return winner;
+					}
+				}
+				//height-numbers
+				for(int i=1; i<4; i++)
+    			{
+    				if(this->board[k][l][i][i]==mini4DgamePlayerColor::none || this->board[k][l][0][0] != this->board[k][l][i][i])
+    					break;
+    				if(i==3)
+    				{
+						winner.color_ = this->board[k][l][0][0];
+						for(int x=0; x<4; x++){
+							winner.winningRow[x] = k;
+							winner.winningColumn[x] = l;
+							winner.winningHeight[x] = x;
+							winner.winningNumber[x] = x;
+						}
+						return winner;
+					}
+				}
+				for(int i=1; i<4; i++)
+    			{
+    				if(this->board[k][l][3-i][i]==mini4DgamePlayerColor::none || this->board[k][l][3][0] != this->board[k][l][3-i][i])
+    					break;
+    				if(i==3)
+    				{
+						winner.color_ = this->board[k][l][3][0];
+						for(int x=0; x<4; x++){
+							winner.winningRow[x] = k;
+							winner.winningColumn[x] = l;
+							winner.winningHeight[x] = 3-x;
+							winner.winningNumber[x] = x;
+						}
+						return winner;
+					}
+				}
+    		}
+    	}
+
+    	//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])
+    				{
+    					winner.color_ = this->board[0][j][k][l];
+						for(int x=0; x<4; x++){
+							winner.winningRow[x] = x;
+							winner.winningColumn[x] = j;
+							winner.winningHeight[x] = k;
+							winner.winningNumber[x] = l;
+						}
+						return winner;
+    				}
+    			}
+    		}
+    	}
+
+    	//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])
+    				{
+    	    			winner.color_ = this->board[i][0][k][l];
+						for(int x=0; x<4; x++){
+							winner.winningRow[x] = i;
+							winner.winningColumn[x] = x;
+							winner.winningHeight[x] = k;
+							winner.winningNumber[x] = l;
+						}
+						return winner;
+    				}
+    			}
+    		}
+    	}
+
+    	//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])
+    				{
+    					winner.color_ = this->board[i][j][0][l];
+						for(int x=0; x<4; x++){
+							winner.winningRow[x] = i;
+							winner.winningColumn[x] = j;
+							winner.winningHeight[x] = x;
+							winner.winningNumber[x] = l;
+						}
+						return winner;
+    				}
+    			}
+    		}
+    	}
+
+    	//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])
+    				{
+    					winner.color_ = this->board[i][j][k][0];
+						for(int x=0; x<4; x++){
+							winner.winningRow[x] = i;
+							winner.winningColumn[x] = j;
+							winner.winningHeight[x] = k;
+							winner.winningNumber[x] = x;
+						}
+						return winner;
+    				}
+    			}
+    		}
+    	}
+    	return winner;
+    }
+
+    /**
+    @brief
+        Is called when the gametype has changed.
+    */
+    void Mini4DgameBoard::changedGametype()
+    {
+        SUPER(Mini4DgameBoard, changedGametype);
+
+        // Check, whether it's still Mini4Dgame.
+        this->checkGametype();
+    }
+
+    /**
+    @brief
+        Checks whether the gametype is Mini4Dgame and if it is, sets its centerpoint.
+    */
+    void Mini4DgameBoard::checkGametype()
+    {
+        if (this->getGametype() != NULL && this->getGametype()->isA(Class(Mini4Dgame)))
+        {
+            Mini4Dgame* Mini4DgameGametype = orxonox_cast<Mini4Dgame*>(this->getGametype().get());
+            Mini4DgameGametype->setGameboard(this);
+        }
+    }
+}
Index: code/branches/minigame4DHS14/src/modules/mini4dgame/Mini4DgameBoard.h
===================================================================
--- code/branches/minigame4DHS14/src/modules/mini4dgame/Mini4DgameBoard.h	(revision 10226)
+++ code/branches/minigame4DHS14/src/modules/mini4dgame/Mini4DgameBoard.h	(revision 10226)
@@ -0,0 +1,86 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file Mini4DgameBoard.h
+    @brief Declaration of the Mini4DgameBoard class.
+    @ingroup Pong
+*/
+
+#ifndef _Mini4DgameBoard_H__
+#define _Mini4DgameBoard_H__
+
+#include "mini4Dgame/Mini4DgamePrereqs.h"
+
+#include "worldentities/StaticEntity.h"
+
+namespace orxonox
+{
+
+	struct Mini4DgameWinner
+	{
+		int winningRow[4];
+		int winningColumn[4];
+		int winningHeight[4];
+		int winningNumber[4];
+		int color_;
+	};
+
+    /**
+    @brief
+        This class manages the board for @ref orxonox::Mini4Dgame "Mini4Dgame".
+
+    @author
+        Oliver Richter
+    */
+    class _Mini4DgameExport Mini4DgameBoard : public StaticEntity
+    {
+        public:
+    		Mini4DgameBoard(Context* context);
+            //virtual ~Mini4DgameBoard();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+            bool isValidMove(const Vector4 move);
+            void undoMove();
+            void makeMove(const Vector4 move);
+            Mini4DgameWinner getWinner();
+
+            void changedGametype();
+            void checkGametype();
+
+        private:
+            //void registerVariables();
+            std::vector<Vector4> moves;
+            bool player_toggle_;
+            BlinkingBillboard* blinkingBillboards[4][4][4][4];
+            int board[4][4][4][4]; //!< The logical board where the game takes place. board[row][column][height][number]
+    };
+}
+
+#endif /* _Mini4DgameBoard_H__ */
Index: code/branches/minigame4DHS14/src/modules/mini4dgame/Mini4DgamePrereqs.h
===================================================================
--- code/branches/minigame4DHS14/src/modules/mini4dgame/Mini4DgamePrereqs.h	(revision 10226)
+++ code/branches/minigame4DHS14/src/modules/mini4dgame/Mini4DgamePrereqs.h	(revision 10226)
@@ -0,0 +1,74 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+@file
+@brief
+    Shared library macros, enums, constants and forward declarations for the pong module
+*/
+
+#ifndef _Mini4DgamePrereqs_H__
+#define _Mini4DgamePrereqs_H__
+
+#include "OrxonoxConfig.h"
+#include "OrxonoxPrereqs.h"
+
+//-----------------------------------------------------------------------
+// Shared library settings
+//-----------------------------------------------------------------------
+
+#if defined(ORXONOX_PLATFORM_WINDOWS) && !defined(Mini4Dgame_STATIC_BUILD)
+#  ifdef Mini4Dgame_SHARED_BUILD
+#    define _Mini4DgameExport __declspec(dllexport)
+#  else
+#    if defined( __MINGW32__ )
+#      define _Mini4DgameExport
+#    else
+#      define _Mini4DgameExport __declspec(dllimport)
+#    endif
+#  endif
+#  define _Mini4DgamePrivate
+#elif defined (ORXONOX_GCC_VISIBILITY)
+#  define _Mini4DgameExport  __attribute__ ((visibility("default")))
+#  define _Mini4DgamePrivate __attribute__ ((visibility("hidden")))
+#else
+#  define _Mini4DgameExport
+#  define _Mini4DgamePrivate
+#endif
+
+//-----------------------------------------------------------------------
+// Forward declarations
+//-----------------------------------------------------------------------
+
+namespace orxonox
+{
+    class Mini4Dgame;
+    class Mini4DgameBoard;
+}
+
+#endif /* _PongPrereqs_H__ */
