Index: code/branches/presentationFS15/src/modules/objects/Turret.cc
===================================================================
--- code/branches/presentationFS15/src/modules/objects/Turret.cc	(revision 10444)
+++ code/branches/presentationFS15/src/modules/objects/Turret.cc	(revision 10452)
@@ -223,4 +223,5 @@
         XMLPortParam(Turret, "maxYaw", setMaxYaw, getMaxYaw, xmlelement, mode);
         XMLPortParam(Turret, "maxPitch", setMaxPitch, getMaxPitch, xmlelement, mode);
+        XMLPortParam(Turret, "rotationThrust", setRotationThrust, getRotationThrust, xmlelement, mode);
     }
 
Index: code/branches/presentationFS15/src/modules/objects/Turret.h
===================================================================
--- code/branches/presentationFS15/src/modules/objects/Turret.h	(revision 10444)
+++ code/branches/presentationFS15/src/modules/objects/Turret.h	(revision 10452)
@@ -102,4 +102,10 @@
                 { return this->maxYaw_; }
 
+            inline void setRotationThrust(float rotationthrust)
+            	{ this->rotationThrust_ = rotationthrust; }
+
+            inline float getRotationThrust()
+            	{ return this->rotationThrust_; }
+
         protected:
             Vector3 startDir_; //!< The initial facing direction, in local coordinates.
Index: code/branches/presentationFS15/src/modules/objects/controllers/TurretController.cc
===================================================================
--- code/branches/presentationFS15/src/modules/objects/controllers/TurretController.cc	(revision 10444)
+++ code/branches/presentationFS15/src/modules/objects/controllers/TurretController.cc	(revision 10452)
@@ -104,5 +104,5 @@
         {
             Pawn* entity = orxonox_cast<Pawn*>(*it);
-            if (!entity || FormationController::sameTeam(this->getControllableEntity(), entity, this->getGametype()))
+            if (!entity || FormationController::sameTeam(turret, entity, this->getGametype()))
                 continue;
             tempScore = turret->isInRange(entity);
@@ -196,4 +196,5 @@
             if(this->isLookingAtTargetNew(Degree(5).valueRadians()))
             {
+
                 this->getControllableEntity()->fire(0);
             }
Index: code/branches/presentationFS15/src/modules/tetris/Tetris.h
===================================================================
--- code/branches/presentationFS15/src/modules/tetris/Tetris.h	(revision 10444)
+++ code/branches/presentationFS15/src/modules/tetris/Tetris.h	(revision 10452)
@@ -90,5 +90,4 @@
             void clearRow(unsigned int row);
 
-
             PlayerInfo* player_;
 
Index: code/branches/presentationFS15/src/modules/towerdefense/CMakeLists.txt
===================================================================
--- code/branches/presentationFS15/src/modules/towerdefense/CMakeLists.txt	(revision 10444)
+++ code/branches/presentationFS15/src/modules/towerdefense/CMakeLists.txt	(revision 10452)
@@ -2,5 +2,4 @@
   TowerDefense.cc
   TowerDefenseTower.cc
-  TowerTurret.cc
   TowerDefenseCenterpoint.cc
   TowerDefenseHUDController.cc
@@ -8,5 +7,5 @@
   TDCoordinate.cc
   TowerDefenseEnemy.cc
-
+  TowerDefenseSelecter.cc
 )
 
@@ -17,4 +16,5 @@
     orxonox
     overlays
+    objects
   SOURCE_FILES ${TOWERDEFENSE_SRC_FILES}
 )
Index: code/branches/presentationFS15/src/modules/towerdefense/TDCoordinate.cc
===================================================================
--- code/branches/presentationFS15/src/modules/towerdefense/TDCoordinate.cc	(revision 10444)
+++ code/branches/presentationFS15/src/modules/towerdefense/TDCoordinate.cc	(revision 10452)
@@ -17,13 +17,50 @@
     {
         //RegisterObject(TDCoordinate);
-        x=0;
-        y=0;
+        Set(0,0);
 
     }
 
     TDCoordinate::TDCoordinate(int x, int y)
-    {
-        this->x=x;
-        this->y=y;
+    {        
+        Set(x,y);
+    }
+
+    void TDCoordinate::Set(int x, int y)
+    {        
+        if (x < 0)
+        {
+            _x = 0;
+        }
+        else if (x > 15)
+        {
+            _x = 15;
+        }
+        else
+        {
+            _x = x;
+        }
+
+        if (y < 0)
+        {
+            _y = 0;
+        }
+        else if (y > 15)
+        {
+            _y = 15;
+        }
+        else
+        {
+            _y = y;
+        }
+    }
+
+    int TDCoordinate::GetX()
+    {        
+        return _x;
+    }
+
+    int TDCoordinate::GetY()
+    {        
+        return _y;
     }
 
@@ -34,6 +71,6 @@
 
         Vector3 *coord = new Vector3();
-        coord->x= (x-8) * tileScale;
-        coord->y= (y-8) * tileScale;
+        coord->x= (_x-8) * tileScale;
+        coord->y= (_y-8) * tileScale;
         coord->z=100;
 
Index: code/branches/presentationFS15/src/modules/towerdefense/TDCoordinate.h
===================================================================
--- code/branches/presentationFS15/src/modules/towerdefense/TDCoordinate.h	(revision 10444)
+++ code/branches/presentationFS15/src/modules/towerdefense/TDCoordinate.h	(revision 10452)
@@ -16,14 +16,15 @@
     {
         public:
-            int x;
-            int y;
+            TDCoordinate();
+            TDCoordinate(int x, int y);
+            virtual ~TDCoordinate() {};
+            virtual void Set(int x, int y);
+            virtual int GetX();
+            virtual int GetY();
+            virtual Vector3 get3dcoordinate(); 
 
-            TDCoordinate();
-
-            Vector3 get3dcoordinate();
-
-            virtual ~TDCoordinate() {};
-
-            TDCoordinate(int x, int y);
+        private:
+            int _x;
+            int _y;
     };
 
Index: code/branches/presentationFS15/src/modules/towerdefense/Tower.cc
===================================================================
--- code/branches/presentationFS15/src/modules/towerdefense/Tower.cc	(revision 10444)
+++ 	(revision )
@@ -1,113 +1,0 @@
-//
-//  Tower.cc
-//  Orxonox
-//
-//  Created by Fabian Mentzer on 29.04.12.
-//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
-//
-
-/* Not implemented fully */
-
-#include "Tower.h"
-
-#include "core/CoreIncludes.h"
-//#include "core/XMLPort.h"
-
-namespace orxonox
-{
-    RegisterClass(Tower);
-
-    /**
-    @brief
-        Constructor. Registers and initializes the object.
-    */
-    Tower::Tower(Context* context) : Pawn(context)
-    {
-        RegisterObject(Tower);
-
-        this->setCollisionType(WorldEntity::Dynamic);
-
-        //this->removeAllEngines();
-
-        /*
-        this->size_ = 10.0f;
-        this->delay_ = false;
-        this->delayTimer_.setTimer(0.2f, false, createExecutor(createFunctor(&TetrisStone::enableMovement, this)));
-        */
-    }
-
-    void Tower::setOrientation(const Quaternion& orientation)
-    {
-        static int ori;
-        //orxout() << "orientation " << ++ori << endl;
-    }
-
-    void Tower::rotateYaw(const Vector2& value)
-    {
-        static int yaw;
-        //orxout() << "rotateYaw " << ++yaw << endl;
-    }
-
-    void Tower::rotatePitch(const Vector2& value)
-    {
-        static int pitch;
-        //orxout() << "rotatePitch " << ++pitch << endl;
-    }
-
-    void Tower::rotateRoll(const Vector2& value)
-    {
-        static int roll;
-        //orxout() << "rotateRoll" << ++roll << endl;
-    }
-
-    // This function is called whenever a player presses the up or the down key.
-    // You have to implement what happens when the up or the down key is pressed.
-    // value.x < 0 means: down key is pressed.
-    // I suggest to create a new class which is a controllable entity I will refer to as "TowerMover". This is the controllable entity that the
-    // player controls in order to move the tower along the centerpoint and in order to place the tower at the appropriate position.
-    //
-
-    // The tower itsself is controlled by a WayPointPatroController at the instance you place it on the centerpoint.
-    //(don't forget to set the team_ parameter such that all tower are in the same team)
-
-    //How to move a tower: simply attach the tower to the TowerMover
-    //How to place a tower: detach the tower from the TowerMover
-
-    /**
-    @brief
-        Overloaded the function to rotate the stone.
-    @param value
-        A vector whose first component is the angle by which to rotate.
-    */
-    /*
-    void Tower::moveFrontBack(const Vector2& value)
-    {
-        //orxout() << "frontBack.x: " << value.x << endl;
-    }
-    */
-
-    /**
-    @brief
-        Overloaded the function to steer the stone right and left
-    @param value
-        A vector whose first component is the direction in which we want to steer the stone.
-    */
-    /*
-    void Tower::moveRightLeft(const Vector2& value)
-    {
-        //orxout() << "rightLeft.x: " << value.x << endl;
-
-        if(!this->delay_)
-        {
-            const Vector3& position = this->getPosition();
-            Vector3 newPos = Vector3(position.x+value.x/abs(value.x)*this->size_, position.y, position.z);
-            if(!this->tetris_->isValidMove(this, newPos))
-                return;
-
-            this->setPosition(newPos);
-            this->delay_ = true;
-            this->delayTimer_.startTimer();
-        }
-    }
-    */
-}
Index: code/branches/presentationFS15/src/modules/towerdefense/Tower.h
===================================================================
--- code/branches/presentationFS15/src/modules/towerdefense/Tower.h	(revision 10444)
+++ 	(revision )
@@ -1,52 +1,0 @@
-//
-//  Tower.h
-//  Orxonox
-//
-//  Created by Fabian Mentzer on 29.04.12.
-//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
-//
-
-/**
-@brief
-See TowerDefenseReadme.txt for Information.
-
-@ingroup TowerDefense
-*/
-
-
-#ifndef Orxonox_Tower_h
-#define Orxonox_Tower_h
-
-#include "towerdefense/TowerDefensePrereqs.h"
-#include "worldentities/pawns/SpaceShip.h"
-
-
-namespace orxonox
-{
-    class _TowerDefenseExport Tower : public Pawn
-    {
-    public:
-        Tower(Context* context);
-        virtual ~Tower() {};
-
-        // Maybe later override these to move towers with cursor keys
-        /*
-        virtual void moveFrontBack(const Vector2& value);
-        virtual void moveRightLeft(const Vector2& value);
-        */
-
-        // Overriding these to stop towers from spasing out
-        void setOrientation(const Quaternion& orientation);
-        virtual void rotateYaw(const Vector2& value);
-        virtual void rotatePitch(const Vector2& value);
-        virtual void rotateRoll(const Vector2& value);
-
-        void setGame(TowerDefense* towerdefense)
-        { assert(towerdefense); game_ = towerdefense; }
-    private:
-        TowerDefense* game_;
-    };
-}
-
-
-#endif
Index: code/branches/presentationFS15/src/modules/towerdefense/TowerDefense.cc
===================================================================
--- code/branches/presentationFS15/src/modules/towerdefense/TowerDefense.cc	(revision 10444)
+++ code/branches/presentationFS15/src/modules/towerdefense/TowerDefense.cc	(revision 10452)
@@ -37,5 +37,4 @@
  *
  *
- *
  *TIPP: Eclipse hilft euch schnell auf bereits vorhanden Funktionen zuzugreifen:
  * einfach "this->" eingeben und kurz warten. Dann tauch eine Liste mit Vorschlägen auf. Wenn ihr jetzt weiter
@@ -77,5 +76,4 @@
 #include "TowerDefenseCenterpoint.h"
 //#include "TDCoordinate.h"
-#include "TowerTurret.h"
 #include "worldentities/SpawnPoint.h"
 #include "worldentities/pawns/Pawn.h"
@@ -88,10 +86,24 @@
 /* Part of a temporary hack to allow the player to add towers */
 #include "core/command/ConsoleCommand.h"
+#include <cmath>
+
 
 namespace orxonox
 {
+    static const std::string __CC_addTower_name  = "addTower";
+    static const std::string __CC_upgradeTower_name = "upgradeTower";
+    static const int upgradeCost = 20;
+    static const int towerCost = 20;
+    unsigned int maxspaceships = 30;
+    int maxspaceshipsstandard = 30;
+
+
+
+    SetConsoleCommand("TowerDefense", __CC_addTower_name,  &TowerDefense::addTower ).addShortcut().defaultValues(1);
+    SetConsoleCommand("TowerDefense", __CC_upgradeTower_name, &TowerDefense::upgradeTower).addShortcut().defaultValues(0);
+
     RegisterUnloadableClass(TowerDefense);
 
-    TowerDefense::TowerDefense(Context* context) : Deathmatch(context)
+    TowerDefense::TowerDefense(Context* context) : TeamDeathmatch(context)
     {
         RegisterObject(TowerDefense);
@@ -103,11 +115,23 @@
         }*/
 
+        //Timer for the waves (10 seconds between the waves)
+        selecter = NULL;
+        this->player_ = NULL;        
         this->setHUDTemplate("TowerDefenseHUD");
-
-        //this->stats_ = new TowerDefensePlayerStats();
-
-        /* Temporary hack to allow the player to add towers and upgrade them */
-        this->dedicatedAddTower_ = createConsoleCommand( "addTower", createExecutor( createFunctor(&TowerDefense::addTower, this) ) );
-        this->dedicatedUpgradeTower_ = createConsoleCommand( "upgradeTower", createExecutor( createFunctor(&TowerDefense::upgradeTower, this) ) );
+        this->nextwaveTimer_.setTimer(10, false, createExecutor(createFunctor(&TowerDefense::nextwave, this)));
+        this->nextwaveTimer_.stopTimer();
+        this->waves_ = 0;
+        this->time = 0;
+        this->credit_ = 0;
+        this->lifes_ = 0;
+        this->timeSetTower_ = 0;
+        spaceships =15;
+        eggs=3;
+        ufos=7;
+        randomships=5;
+
+
+        ModifyConsoleCommand(__CC_addTower_name).setObject(this);
+        ModifyConsoleCommand(__CC_upgradeTower_name).setObject(this);
     }
 
@@ -117,6 +141,6 @@
         if (this->isInitialized())
         {
-            if( this->dedicatedAddTower_ )
-                delete this->dedicatedAddTower_;
+            ModifyConsoleCommand(__CC_addTower_name).setObject(NULL);
+            ModifyConsoleCommand(__CC_upgradeTower_name).setObject(NULL);
         }
     }
@@ -131,38 +155,70 @@
     void TowerDefense::start()
     {
-
-        Deathmatch::start();
-
-// Waypoints: [1,3] [10,3] [10,11] [13,11] -> add the points to a matrix so the player cant place towers on the path
-        for (int i=0; i < 16 ; i++){
-            for (int j = 0; j< 16 ; j++){
-                towermatrix[i][j] = false;
+        if (center_ != NULL) // There needs to be a TowerDefenseCenterpoint, i.e. the area the game takes place.
+        {
+            if (selecter == NULL)
+            {
+                selecter = new TowerDefenseSelecter(this->center_->getContext());                
             }
-        }
-
+            selecter->addTemplate(center_->getSelecterTemplate());
+            center_->attach(selecter);
+        }
+        else // If no centerpoint was specified, an error is thrown and the level is exited.
+        {
+            orxout(internal_error) << "Jump: No Centerpoint specified." << endl;
+            return;
+        }
+
+        TeamDeathmatch::start();
+
+        // Waypoints: [1,3] [10,3] [10,11] [13,11] -> add the points to a matrix so the player cant place towers on the path
+        for (int i=0; i < 16 ; i++)
+        {
+            for (int j = 0; j< 16 ; j++)
+            {
+                towerModelMatrix[i][j] = NULL;
+                towerTurretMatrix[i][j] = NULL;
+            }
+        }
+
+        
+
+        if (player_ != NULL)
+        {
+            //this->player_->startControl(selecter);
+        }
+        else
+        {
+            orxout() << "player=NULL" << endl;
+        }
+
+
+        Model* dummyModel = new Model(this->center_->getContext());
+
+        //the path of the spacehips has to be blocked, so that no towers can be build there
         for (int k=0; k<3; k++)
-            towermatrix[1][k]=true;
+            towerModelMatrix[1][k]=dummyModel;
         for (int l=1; l<11; l++)
-            towermatrix[l][3]=true;
+        	towerModelMatrix[l][3]=dummyModel;
         for (int m=3; m<12; m++)
-            towermatrix[10][m]=true;
+        	towerModelMatrix[10][m]=dummyModel;
         for (int n=10; n<14; n++)
-            towermatrix[n][11]=true;
+        	towerModelMatrix[n][11]=dummyModel;
         for (int o=13; o<16; o++)
-            towermatrix[13][o]=true;
+        	towerModelMatrix[13][o]=dummyModel;
+
 
         //set initial credits, lifes and WaveNumber
-        this->setCredit(200);
-        this->setLifes(50);
+        this->setCredit(100);
+        this->setLifes(100);
         this->setWaveNumber(0);
         time=0.0;
 
+        /*
         //adds initial towers
         for (int i=0; i <7; i++){
             addTower(i+3,4);
-        }/*
-        for (int j=0; j < 7; j++){
-            addTower(9,j+5);
-        }*/
+        }
+		*/
     }
 
@@ -178,5 +234,6 @@
             en1->addTemplate("enemytowerdefense1");
             en1->setScale(3);
-            en1->setHealth(en1->getHealth() + this->getWaveNumber()*4);
+            en1->lookAt(Vector3(0,0,100000));
+            en1->setHealth(en1->getHealth() +50 + this->getWaveNumber()*4);
             break;
 
@@ -184,5 +241,7 @@
             en1->addTemplate("enemytowerdefense2");
             en1->setScale(2);
-            en1->setHealth(en1->getHealth() + this->getWaveNumber()*4);
+            en1->lookAt(Vector3(0,0,100000));
+            en1->roll(Degree(120));
+            en1->setHealth(en1->getHealth() -30 + this->getWaveNumber()*4);
             //  en1->setShieldHealth(en1->getShield() = this->getWaveNumber()*2))
             break;
@@ -191,10 +250,13 @@
             en1->addTemplate("enemytowerdefense3");
             en1->setScale(1);
-            en1->setHealth(en1->getHealth() + this->getWaveNumber()*4);
+            en1->lookAt(Vector3(0,0,100000));
+            en1->roll(Degree(120));
+            en1->setHealth(en1->getHealth() -10 + this->getWaveNumber()*4);
             break;
         }
 
+        en1->setTeam(2);
         en1->getController();
-        en1->setPosition(path.at(0)->get3dcoordinate());
+        en1->setPosition(path.at(0)->get3dcoordinate());        
         TowerDefenseEnemyvector.push_back(en1);
 
@@ -209,13 +271,40 @@
     {
 
-        Deathmatch::end();
+        TeamDeathmatch::end();
         ChatManager::message("Match is over! Gameover!");
 
+    }
+
+    void TowerDefense::spawnPlayer(PlayerInfo* player)
+    {
+        assert(player);
+        this->player_ = player;
+
+        if (selecter->getPlayer() == NULL)
+        {
+            this->player_ = player;
+            player->startControl(selecter);
+            players_[player].state_ = PlayerState::Alive;
+        } 
+    }
+
+    /**
+    @brief
+        Get the player.
+    @return
+        Returns a pointer to the player. If there is no player, NULL is returned.
+    */
+    PlayerInfo* TowerDefense::getPlayer(void) const
+    {
+        return this->player_;
     }
 
     //not working yet
     void TowerDefense::upgradeTower(int x,int y)
-    {/*
-        const int upgradeCost = 20;
+    {
+        TDCoordinate* coord = new TDCoordinate(x,y);
+        x = coord->GetX();
+        y = coord->GetY();
+        
 
         if (!this->hasEnoughCreditForTower(upgradeCost))
@@ -225,5 +314,8 @@
         }
 
-        if (towermatrix [x][y] == NULL)
+
+        Model* dummyModel2 = new Model(this->center_->getContext());
+
+        if (towerModelMatrix [x][y] == NULL || (towerModelMatrix [x][y])->getMeshSource() == dummyModel2->getMeshSource())
         {
             orxout() << "no tower on this position" << endl;
@@ -233,15 +325,37 @@
         else
         {
-            (towermatrix [x][y])->upgradeTower();
-        }*/
+            (towerTurretMatrix [x][y])->upgradeTower();
+            switch(towerTurretMatrix[x][y]->upgrade)
+                   {
+                   case 1 :
+                	   towerModelMatrix[x][y]->setMeshSource("TD_T2.mesh");
+                	   break;
+
+                   case 2 :
+                	   towerModelMatrix[x][y]->setMeshSource("TD_T3.mesh");
+                	   break;
+                   case 3 :
+                	   towerModelMatrix[x][y]->setMeshSource("TD_T4.mesh");
+                	   break;
+                   case 4 :
+                	   towerModelMatrix[x][y]->setMeshSource("TD_T5.mesh");
+                	   break;
+
+                   }
+
+            this->buyTower(upgradeCost);
+        }
     }
 
     /*adds Tower at Position (x,y) and reduces credit and adds the point to the towermatrix. template ("towerturret")
     so towers have ability if the turrets
-
     */
+
     void TowerDefense::addTower(int x, int y)
-    {
-        const int towerCost = 20;
+    {        
+        TDCoordinate* coord = new TDCoordinate(x,y);
+        x = coord->GetX();
+        y = coord->GetY();
+
 
         if (!this->hasEnoughCreditForTower(towerCost))
@@ -251,5 +365,5 @@
         }
 
-        if (towermatrix [x][y]==true)
+        if (towerModelMatrix [x][y]!=NULL)
         {
             orxout() << "not possible to put tower here!!" << endl;
@@ -264,23 +378,33 @@
         int tileScale = (int) this->center_->getTileScale();
 
-        if (x > 15 || y > 15 || x < 0 || y < 0)
+        /*if (x > 15 || y > 15 || x < 0 || y < 0)
         {
             //Hard coded: TODO: let this depend on the centerpoint's height, width and fieldsize (fieldsize doesn't exist yet)
             orxout() << "Can not add Tower: x and y should be between 0 and 15" << endl;
             return;
-        }
-
-        orxout() << "Will add tower at (" << (x-8) * tileScale << "," << (y-8) * tileScale << ")" << endl;
-
-       //Reduce credit
-        this->buyTower(towerCost);
-        towermatrix [x][y]=true;
+        }*/
+
+        //orxout() << "Will add tower at (" << (x-8) * tileScale << "," << (y-8) * tileScale << ")" << endl;
+        orxout() << "Will add tower at (" << x << "," << y << ")" << endl;
+
+
+        //Create Model
+        Model* newTowerModel = new Model(this->center_->getContext());
+        newTowerModel->setMeshSource("TD_T1.mesh");
+        newTowerModel->setScale(30);
+        newTowerModel->pitch(Degree(90));
+        newTowerModel->setPosition(static_cast<float>((x-8) * tileScale), static_cast<float>((y-8) * tileScale), 80);
 
         //Creates tower
         TowerDefenseTower* towernew = new TowerDefenseTower(this->center_->getContext());
-        towernew->addTemplate("towerturret");
-        towernew->setPosition(static_cast<float>((x-8) * tileScale), static_cast<float>((y-8) * tileScale), 75);
+        towernew->setPosition(static_cast<float>((x-8) * tileScale), static_cast<float>((y-8) * tileScale), 275);
         towernew->setGame(this);
-    }
+        towernew->setTeam(1);
+
+        //Reduce credit
+         this->buyTower(towerCost);
+         towerModelMatrix [x][y]= newTowerModel;
+         towerTurretMatrix [x][y]= towernew;
+    }    
 
     bool TowerDefense::hasEnoughCreditForTower(int towerCost)
@@ -296,18 +420,136 @@
 
  
+    void TowerDefense::nextwave()
+    {
+
+    	orxout() << "newwave" << endl;
+    	TowerDefenseEnemyvector.clear();
+    	waves_++;
+        //maxspaceships = round(maxspaceshipsstandard + 0.25*(waves_));
+    	time=0;
+
+    	int helpnumber = 40 -(waves_);
+    	if(helpnumber <= 0) {helpnumber =1;}
+        float numSpaceships = std::abs((rand() % 100)*5*(helpnumber));
+        float numEggs = std::abs((rand() % 100)*1*(waves_));
+        float numUfos = std::abs((rand() % 100)*1.5*(0.5*(waves_))) ;
+
+        float totalnumber = (numSpaceships + numEggs + numUfos)*1.3;
+
+        int newspaceships = (int)(maxspaceships* numSpaceships / totalnumber);
+        int neweggs = (int)(maxspaceships*numEggs / totalnumber);
+        int newufos = (int)(maxspaceships*numUfos / totalnumber);
+        int newrandomships = maxspaceships -newspaceships - neweggs - newufos;
+        spaceships =newspaceships;
+        eggs=neweggs;
+        ufos=newufos;
+        randomships=newrandomships;
+
+        orxout() << spaceships << endl;
+        orxout() << eggs << endl;
+        orxout() << ufos << endl;
+        orxout() << randomships << endl;
+
+
+
+
+
+    }
+
     void TowerDefense::tick(float dt)
     {
         SUPER(TowerDefense, tick, dt);
         time +=dt;
+        timeSetTower_ +=dt;
+
+        //Check if tower has to be set (because TowerDefenseSelecter asks for it)
+        if(timeSetTower_ >= 0.25)
+        {
+        	timeSetTower_ =0;
+			if(selecter != NULL && selecter->firePressed_)
+			{
+
+				int x = selecter->selectedPos_->GetX();
+				int y = selecter->selectedPos_->GetY();
+				Model* dummyModel2 = new Model(this->center_->getContext());
+
+
+
+				if(towerModelMatrix[x][y] == NULL)
+				{
+					addTower(x,y);
+				}
+				else
+				{
+					if(!((towerModelMatrix [x][y])->getMeshSource() == dummyModel2->getMeshSource()))
+					{
+						towerTurretMatrix[x][y]->upgradeTower();
+				        if(towerTurretMatrix[x][y]->upgrade < towerTurretMatrix[x][y]->upgradeMax)
+				        {
+				        	int specificupgradecost = (int)(upgradeCost*(std::pow(1.5,towerTurretMatrix[x][y]->upgrade)));
+				        	if(this->credit_ >= specificupgradecost)
+				        	{
+					        	this->buyTower(specificupgradecost);
+								switch(towerTurretMatrix[x][y]->upgrade)
+							   {
+								   case 1 :
+									   towerModelMatrix[x][y]->setMeshSource("TD_T2.mesh");
+									   break;
+
+								   case 2 :
+									   towerModelMatrix[x][y]->setMeshSource("TD_T3.mesh");
+									   break;
+				                   case 3 :
+				                	   towerModelMatrix[x][y]->setMeshSource("TD_T4.mesh");
+				                	   break;
+				                   case 4 :
+				                	   towerModelMatrix[x][y]->setMeshSource("TD_T5.mesh");
+				                	   break;
+
+							   }
+				        	}
+
+
+				        }
+					}
+				}
+				selecter->firePressed_ = false;
+			}
+        }
 
         TDCoordinate* coord1 = new TDCoordinate(1,1);
         std::vector<TDCoordinate*> path;
         path.push_back(coord1);
-        if(time>1 && TowerDefenseEnemyvector.size() < 30)
-        {
-            //adds different types of enemys depending on the WaveNumber
-            addTowerDefenseEnemy(path, this->getWaveNumber() % 3 +1 );
-            time = time-1;
-        }
+
+
+
+
+
+        if(time>=TowerDefenseEnemyvector.size() && TowerDefenseEnemyvector.size() < maxspaceships)
+		{
+
+        	//adds different types of enemys depending on the WaveNumber progressively making the combination of enemys more difficult
+        	if(spaceships>0)
+        	{
+    			addTowerDefenseEnemy(path, 1);
+    			spaceships--;
+
+        	}else if(ufos>0)
+        	{
+    			addTowerDefenseEnemy(path, 3);
+    			ufos--;
+        	}else if(eggs>0)
+        	{
+    			addTowerDefenseEnemy(path, 2);
+    			eggs--;
+        	}else if(randomships>0)
+        	{
+    			addTowerDefenseEnemy(path, rand() % 3 +1);
+    			randomships--;
+
+        	}
+
+		}
+
 
         Vector3* endpoint = new Vector3(500, 700, 150);
@@ -317,5 +559,5 @@
             if(TowerDefenseEnemyvector.at(i) != NULL && TowerDefenseEnemyvector.at(i)->isAlive())
             {
-                //destroys enemys at the end of teh path and reduces the life by 1. no credits gifted
+                //destroys enemys at the end of the path and reduces the life by 1. no credits gifted
 
                 Vector3 ship = TowerDefenseEnemyvector.at(i)->getRVWorldPosition();
@@ -333,4 +575,5 @@
             }
         }
+
         //goes thorugh vector to see if an enemy is still alive. if not next wave is launched
         int count= 0;
@@ -343,7 +586,10 @@
         }
 
+        if (count == 0 && !this->nextwaveTimer_.isActive())
+            this->nextwaveTimer_.startTimer();
+
+/*            time2 +=dt;
         if(count== 0)
         {
-            time2 +=dt;
             if(time2 > 10)
             {
@@ -354,7 +600,8 @@
             }
         }
-
-
-    }
+*/
+
+    }
+
 
     // Function to test if we can add waypoints using code only. Doesn't work yet
@@ -399,5 +646,5 @@
     void TowerDefense::playerEntered(PlayerInfo* player)
     {
-        Deathmatch::playerEntered(player);
+        TeamDeathmatch::playerEntered(player);
 
         const std::string& message = player->getName() + " entered the game";
@@ -407,5 +654,5 @@
     bool TowerDefense::playerLeft(PlayerInfo* player)
     {
-        bool valid_player = Deathmatch::playerLeft(player);
+        bool valid_player = TeamDeathmatch::playerLeft(player);
 
         if (valid_player)
@@ -437,5 +684,5 @@
         }
 
-        Deathmatch::pawnKilled(victim, killer);
+        TeamDeathmatch::pawnKilled(victim, killer);
     }
 
Index: code/branches/presentationFS15/src/modules/towerdefense/TowerDefense.h
===================================================================
--- code/branches/presentationFS15/src/modules/towerdefense/TowerDefense.h	(revision 10444)
+++ code/branches/presentationFS15/src/modules/towerdefense/TowerDefense.h	(revision 10452)
@@ -38,13 +38,17 @@
 #define _TowerDefense_H__
 #include "TDCoordinate.h"
+#include "TowerDefenseSelecter.h"
 #include "towerdefense/TowerDefensePrereqs.h"
-#include "gametypes/Deathmatch.h"
+#include "gametypes/TeamDeathmatch.h"
 #include "TowerDefenseEnemy.h"
 #include "util/Output.h"
 #include "core/object/WeakPtr.h"
+#include "TowerDefenseSelecter.h"
+#include "graphics/Camera.h"    
+
 
 namespace orxonox
 {
-    class _TowerDefenseExport TowerDefense : public Deathmatch
+    class _TowerDefenseExport TowerDefense : public TeamDeathmatch
     {
     public:
@@ -53,12 +57,12 @@
 
         std::vector<orxonox::WeakPtr<TowerDefenseEnemy> > TowerDefenseEnemyvector;
-        bool towermatrix[16][16];
+        Model* towerModelMatrix[16][16];
+        TowerDefenseTower* towerTurretMatrix[16][16];
         void addTowerDefenseEnemy(std::vector<TDCoordinate*> path, int templatenr);
         virtual void start(); //<! The function is called when the gametype starts
         virtual void end();
         virtual void tick(float dt);
-        //virtual void playerEntered(PlayerInfo* player);
-        //virtual bool playerLeft(PlayerInfo* player);
-        //Player Stats (set,get, reduce)
+        virtual void spawnPlayer(PlayerInfo* player);
+        PlayerInfo* getPlayer(void) const;
         int getCredit(){ return this->credit_; }
         int getLifes(){ return this->lifes_; }
@@ -69,6 +73,12 @@
         void buyTower(int cost){ credit_ -= cost;}
         void addCredit(int credit) { credit_+=credit; }
-        void nextwave(){ waves_++;}
+        void nextwave();
         int reduceLifes(int NumberofLifes){ return lifes_-=NumberofLifes; }
+        TowerDefenseSelecter* selecter;
+        int spaceships;
+        int eggs;
+        int ufos;
+        int randomships;
+
 
         //virtual void pawnKilled(Pawn* victim, Pawn* killer = 0);
@@ -83,9 +93,5 @@
         /* Adds a tower at x, y in the playfield */
         void addTower(int x, int y);
-
         void upgradeTower(int x, int y);
-        /* Part of a temporary hack to allow the player to add towers */
-        ConsoleCommand* dedicatedAddTower_;
-        ConsoleCommand* dedicatedUpgradeTower_;
 
         //TODO: void spawnNewWave()
@@ -96,17 +102,16 @@
     private:
         TowerDefenseCenterpoint *center_;
+        PlayerInfo* player_;
         float time;
-        float time2;
+        float timeSetTower_;
+//        float time2;
         int credit_;
         int waves_;
         int lifes_;
+        Timer nextwaveTimer_;
 
         /* handles stats */
         bool hasEnoughCreditForTower(int towerCost);
         bool hasEnoughCreditForUpgrade();
-
-
-
-        std::vector<TowerTurret*> towers_;
     };
 }
Index: code/branches/presentationFS15/src/modules/towerdefense/TowerDefenseCenterpoint.cc
===================================================================
--- code/branches/presentationFS15/src/modules/towerdefense/TowerDefenseCenterpoint.cc	(revision 10444)
+++ code/branches/presentationFS15/src/modules/towerdefense/TowerDefenseCenterpoint.cc	(revision 10452)
@@ -53,5 +53,4 @@
         this->width_ = 15;
         this->height_ = 15;
-        this->towerTemplate_ = "";
 
         //this->setCollisionType(Static);
@@ -72,5 +71,5 @@
         XMLPortParam(TowerDefenseCenterpoint, "height", setHeight, getHeight, xmlelement, mode);
         XMLPortParam(TowerDefenseCenterpoint, "tileScale", setTileScale, getTileScale, xmlelement, mode);
-        XMLPortParam(TowerDefenseCenterpoint, "towerTemplate", setTowerTemplate, getTowerTemplate, xmlelement, mode);
+        XMLPortParam(TowerDefenseCenterpoint, "selecterTemplate", setSelecterTemplate, getSelecterTemplate, xmlelement, mode);
 
         //TODO: add XMLPortObject(TowerDefenseCenterpoint, WorldEntity, "waypoints", addWaypoint, getWaypoint,  xmlelement, mode);
Index: code/branches/presentationFS15/src/modules/towerdefense/TowerDefenseCenterpoint.h
===================================================================
--- code/branches/presentationFS15/src/modules/towerdefense/TowerDefenseCenterpoint.h	(revision 10444)
+++ code/branches/presentationFS15/src/modules/towerdefense/TowerDefenseCenterpoint.h	(revision 10452)
@@ -60,14 +60,14 @@
             void setWidth(unsigned int width)
                 { this->width_ = width; }
-
             unsigned int getWidth(void) const
                 { return this->width_; }
-
             void setHeight(unsigned int height)
                 { this->height_ = height; }
-
             unsigned int getHeight(void) const
                 { return this->height_; }
-
+            void setSelecterTemplate(const std::string& newTemplate)
+                { this->selecterTemplate_ = newTemplate; }
+            const std::string& getSelecterTemplate() const
+                { return this->selecterTemplate_; }   
             /**
                 @brief How to convert to world coordinates, e.g. that 0,15 is not at -8,-8 but at -80,-80 (if scale would be 10)
@@ -79,22 +79,11 @@
                 { return this->tileScale_; }
 
-            /**
-            @brief Set the template for the towers.
-            @param template The template name to be applied to each tower.
-            */
-            void setTowerTemplate(const std::string& templateName)
-                { this->towerTemplate_ = templateName; }
-
-            const std::string& getTowerTemplate(void) const
-                { return this->towerTemplate_; }
-
         private:
             void checkGametype();
 
+            std::string selecterTemplate_;
             unsigned int width_;
             unsigned int height_;
             unsigned int tileScale_;
-
-            std::string towerTemplate_;
     };
 }
Index: code/branches/presentationFS15/src/modules/towerdefense/TowerDefenseEnemy.cc
===================================================================
--- code/branches/presentationFS15/src/modules/towerdefense/TowerDefenseEnemy.cc	(revision 10444)
+++ code/branches/presentationFS15/src/modules/towerdefense/TowerDefenseEnemy.cc	(revision 10452)
@@ -35,5 +35,9 @@
     //add credit if enemy is destroyed
     TowerDefenseEnemy::~TowerDefenseEnemy(){
-        //this->td->addCredit(1);
+
+    	if (this->isInitialized())
+    	{
+    		getGame()->addCredit(1);
+    	}
     }
 
@@ -64,8 +68,12 @@
         if (getGame() && once_ == false && getHealth() <= 0)
         {
+        	orxout() << "damagefunctionIF" << endl;
             getGame()->addCredit(1);
             once_ = true;
         }
+        orxout() << "damagefunction" << endl;
+
     }
+
 /*
     void TowerDefenseEnemy::popWaypoint()
Index: code/branches/presentationFS15/src/modules/towerdefense/TowerDefenseSelecter.cc
===================================================================
--- code/branches/presentationFS15/src/modules/towerdefense/TowerDefenseSelecter.cc	(revision 10452)
+++ code/branches/presentationFS15/src/modules/towerdefense/TowerDefenseSelecter.cc	(revision 10452)
@@ -0,0 +1,184 @@
+/*
+ *   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:
+ *      Fabien Vultier
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file TowerDefenseSelecter.cc
+    @brief This class represents your figure when you play the minigame. Here the movement of the figure, activating items, ... are handled.
+*/
+
+#include "TowerDefenseSelecter.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "graphics/Model.h"
+
+namespace orxonox
+{
+    RegisterClass(TowerDefenseSelecter);
+
+    TowerDefenseSelecter::TowerDefenseSelecter(Context* context) : ControllableEntity(context)
+    {
+        RegisterObject(TowerDefenseSelecter);
+
+        // initialize variables
+        moveUpPressed_ = false;
+        moveDownPressed_ = false;
+        moveLeftPressed_ = false;
+        moveRightPressed_ = false;
+        firePressed_ = false;
+        setSelectedPosition(6,6);
+        timerSetFire_=0;
+    }
+
+    TowerDefenseSelecter::~TowerDefenseSelecter()
+    {
+
+    }
+
+    void TowerDefenseSelecter::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(TowerDefenseSelecter, XMLPort, xmlelement, mode);
+    }
+
+    void TowerDefenseSelecter::tick(float dt)
+    {
+        SUPER(TowerDefenseSelecter, tick, dt);
+
+
+        if (hasLocalController())
+        {
+        	timerSetFire_ +=dt;
+
+        	if(timerSetFire_ >= 0.25)
+        	{
+        		timerSetFire_ = 0;
+
+        		int selecterPosX = selectedPos_->GetX();
+				int selecterPosY = selectedPos_->GetY();
+
+				if (moveUpPressed_ == true)
+				{
+					moveUpPressed_ = false;
+					selectedPos_->Set(selecterPosX, selecterPosY + 1);
+					updatePosition();
+				}
+				if (moveDownPressed_ == true)
+				{
+					moveDownPressed_ = false;
+					selectedPos_->Set(selecterPosX, selecterPosY - 1);
+					updatePosition();
+				}
+
+				if (moveLeftPressed_ == true)
+				{
+					moveLeftPressed_ = false;
+					selectedPos_->Set(selecterPosX - 1, selecterPosY);
+					updatePosition();
+				}
+				if (moveRightPressed_ == true)
+				{
+					moveRightPressed_ = false;
+					selectedPos_->Set(selecterPosX + 1, selecterPosY);
+					updatePosition();
+				}
+
+
+			}
+
+
+
+        }
+     }
+
+
+    void TowerDefenseSelecter::moveFrontBack(const Vector2& value)
+    {
+        if (value.x > 0)
+        {
+            moveUpPressed_ = true;
+            moveDownPressed_ = false;
+        }
+        else
+        {
+            moveUpPressed_ = false;
+            moveDownPressed_ = true;
+        }
+    }
+
+    void TowerDefenseSelecter::moveRightLeft(const Vector2& value)
+    {
+        if (value.x > 0)
+        {
+            moveLeftPressed_ = false;
+            moveRightPressed_ = true;
+        }
+        else
+        {
+            moveLeftPressed_ = true;
+            moveRightPressed_ = false;
+        }
+    }
+
+    void TowerDefenseSelecter::rotateYaw(const Vector2& value)
+    {
+    }
+
+    void TowerDefenseSelecter::rotatePitch(const Vector2& value)
+    {
+    }
+
+    void TowerDefenseSelecter::rotateRoll(const Vector2& value)
+    {
+    }
+
+
+    void TowerDefenseSelecter::boost(bool bBoost)
+    {
+        firePressed_ = true;
+        orxout() << "boost" << endl;
+    }
+
+
+    void TowerDefenseSelecter::updatePosition()
+    {
+        setPosition(selectedPos_->get3dcoordinate());
+    }
+
+    void TowerDefenseSelecter::setSelectedPosition(TDCoordinate* newPos)
+    {
+        selectedPos_ = newPos;
+        updatePosition();
+    }
+
+    void TowerDefenseSelecter::setSelectedPosition(int x,  int y)
+    {
+        setSelectedPosition(new TDCoordinate(x,y));
+    }
+
+
+}
Index: code/branches/presentationFS15/src/modules/towerdefense/TowerDefenseSelecter.h
===================================================================
--- code/branches/presentationFS15/src/modules/towerdefense/TowerDefenseSelecter.h	(revision 10452)
+++ code/branches/presentationFS15/src/modules/towerdefense/TowerDefenseSelecter.h	(revision 10452)
@@ -0,0 +1,67 @@
+/*
+ *   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:
+ *      Fabien Vultier
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _TowerDefenseSelecter_H__
+#define _TowerDefenseSelecter_H__
+
+#include "towerdefense/TowerDefensePrereqs.h"
+#include "worldentities/ControllableEntity.h"
+#include "TDCoordinate.h"
+
+namespace orxonox
+{
+class _TowerDefenseExport TowerDefenseSelecter : public ControllableEntity
+    {
+        public:
+            TowerDefenseSelecter(Context* context); //!< Constructor. Registers and initializes the object.
+            virtual ~TowerDefenseSelecter();
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);         
+            virtual void tick(float dt);            
+            virtual void moveFrontBack(const Vector2& value); //!< Overloaded the function to steer the bat up and down.
+            virtual void moveRightLeft(const Vector2& value); //!< Overloaded the function to steer the bat up and down.
+            virtual void rotateYaw(const Vector2& value);
+            virtual void rotatePitch(const Vector2& value);
+            virtual void rotateRoll(const Vector2& value);
+            virtual void boost(bool bBoost);
+            virtual void setSelectedPosition(TDCoordinate* newPos);
+            virtual void setSelectedPosition(int x, int y);
+            bool firePressed_;
+            TDCoordinate* selectedPos_;
+
+
+        private:            
+            virtual void updatePosition();
+            float timerSetFire_;
+            bool moveUpPressed_;
+            bool moveDownPressed_;
+            bool moveLeftPressed_;
+            bool moveRightPressed_;            
+    };
+}
+
+#endif /* _TowerDefenseSelecter_H__ */
Index: code/branches/presentationFS15/src/modules/towerdefense/TowerDefenseTower.cc
===================================================================
--- code/branches/presentationFS15/src/modules/towerdefense/TowerDefenseTower.cc	(revision 10444)
+++ code/branches/presentationFS15/src/modules/towerdefense/TowerDefenseTower.cc	(revision 10452)
@@ -22,10 +22,14 @@
         Constructor. Registers and initializes the object.
     */
-    TowerDefenseTower::TowerDefenseTower(Context* context) : Pawn(context)
+    TowerDefenseTower::TowerDefenseTower(Context* context) : Turret(context)
     {
         RegisterObject(TowerDefenseTower);
+        game_ =NULL;
+        this->setCollisionType(WorldEntity::None);
+        upgrade = 0;
+        this->addTemplate("towerdefensetower");
 
-        this->setCollisionType(WorldEntity::Dynamic);
-        upgrade = 0;
+        upgradeMax = 5;
+
 
         //this->removeAllEngines();
@@ -38,4 +42,5 @@
     }
 
+    /*
     void TowerDefenseTower::setOrientation(const Quaternion& orientation)
     {
@@ -53,19 +58,20 @@
     {
     }
+    */
 
     bool TowerDefenseTower::upgradeTower()
     {
-        if(upgrade < 3)
+        if(upgrade < upgradeMax)
         {
             upgrade++;
             float reloadrate = getReloadRate();
             float reloadwaittime = getReloadWaitTime();
-            this->setDamageMultiplier(5000);
-
-            reloadrate = 0.5f*reloadrate;
-            reloadwaittime = 0.5f*reloadwaittime;
+            this->setDamageMultiplier((upgrade+1)*1.5);
+            this->setRotationThrust(2*this->getRotationThrust());
+            reloadrate = 0.7f*reloadrate;
+            reloadwaittime = 0.7f*reloadwaittime;
             setReloadRate(reloadrate);
             setReloadWaitTime(reloadwaittime);
-            this->addTemplate("towerturret1");
+            //this->addTemplate("towerturret1");
         }
         else
Index: code/branches/presentationFS15/src/modules/towerdefense/TowerDefenseTower.h
===================================================================
--- code/branches/presentationFS15/src/modules/towerdefense/TowerDefenseTower.h	(revision 10444)
+++ code/branches/presentationFS15/src/modules/towerdefense/TowerDefenseTower.h	(revision 10452)
@@ -20,9 +20,10 @@
 #include "towerdefense/TowerDefensePrereqs.h"
 #include "worldentities/pawns/SpaceShip.h"
+#include "objects/Turret.h"
 
 
 namespace orxonox
 {
-    class _TowerDefenseExport TowerDefenseTower : public Pawn
+    class _TowerDefenseExport TowerDefenseTower : public Turret
     {
     public:
@@ -37,8 +38,10 @@
 
         // Overriding these to stop TowerDefenseTowers from spasing out
+        /*
         void setOrientation(const Quaternion& orientation);
         virtual void rotateYaw(const Vector2& value);
         virtual void rotatePitch(const Vector2& value);
         virtual void rotateRoll(const Vector2& value);
+        */
         virtual bool upgradeTower();
 
@@ -46,7 +49,9 @@
         void setGame(TowerDefense* Towerdefense)
         { assert(Towerdefense); game_ = Towerdefense; }
+        int upgrade;
+        int upgradeMax;
     private:
         TowerDefense* game_;
-        int upgrade;
+
     };
 }
Index: code/branches/presentationFS15/src/modules/towerdefense/TowerTurret.cc
===================================================================
--- code/branches/presentationFS15/src/modules/towerdefense/TowerTurret.cc	(revision 10444)
+++ 	(revision )
@@ -1,41 +1,0 @@
-//
-//  Tower.cc
-//  Orxonox
-//
-//  Created by Fabian Mentzer on 29.04.12.
-//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
-//
-
-/* Not implemented fully */
-
-//#include "Tower.h"
-#include "TowerTurret.h"
-
-#include "core/CoreIncludes.h"
-//#include "core/XMLPort.h"
-
-namespace orxonox
-{
-    RegisterClass(TowerTurret);
-
-    /**
-    @brief
-        Constructor. Registers and initializes the object.
-    */
-    TowerTurret::TowerTurret(Context* context) : StaticEntity(context)
-    {
-        RegisterObject(TowerTurret);
-
-        this->setCollisionType(WorldEntity::Static);
-
-
-    }
-
-    void TowerTurret::setOrientation(const Quaternion& orientation)
-    {
-        static int ori;
-        orxout() << "orientation " << ++ori << endl;
-    }
-
-
-}
Index: code/branches/presentationFS15/src/modules/towerdefense/TowerTurret.h
===================================================================
--- code/branches/presentationFS15/src/modules/towerdefense/TowerTurret.h	(revision 10444)
+++ 	(revision )
@@ -1,53 +1,0 @@
-//
-//  Tower.h
-//  Orxonox
-//
-//  Created by Fabian Mentzer on 29.04.12.
-//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
-//
-
-/**
-@brief
-See TowerDefenseReadme.txt for Information.
-
-@ingroup TowerDefense
-*/
-
-
-#ifndef Orxonox_Tower_h
-#define Orxonox_Tower_h
-
-#include "towerdefense/TowerDefensePrereqs.h"
-#include "worldentities/pawns/SpaceShip.h"
-#include "worldentities/StaticEntity.h"
-
-
-namespace orxonox
-{
-    class _TowerDefenseExport TowerTurret : public StaticEntity
-    {
-    public:
-        TowerTurret(Context* context);
-        virtual ~TowerTurret() {};
-
-        // Maybe later override these to move towers with cursor keys
-        /*
-        virtual void moveFrontBack(const Vector2& value);
-        virtual void moveRightLeft(const Vector2& value);
-        */
-
-        // Overriding these to stop towers from spasing out
-        void setOrientation(const Quaternion& orientation);
-        //virtual void rotateYaw(const Vector2& value);
-        //virtual void rotatePitch(const Vector2& value);
-        //virtual void rotateRoll(const Vector2& value);
-
-        void setGame(TowerDefense* towerdefense)
-        { assert(towerdefense); game_ = towerdefense; }
-    private:
-        TowerDefense* game_;
-    };
-}
-
-
-#endif
Index: code/branches/presentationFS15/src/orxonox/controllers/FormationController.cc
===================================================================
--- code/branches/presentationFS15/src/orxonox/controllers/FormationController.cc	(revision 10444)
+++ code/branches/presentationFS15/src/orxonox/controllers/FormationController.cc	(revision 10452)
@@ -955,4 +955,6 @@
     bool FormationController::sameTeam(ControllableEntity* entity1, ControllableEntity* entity2, Gametype* gametype)
     {
+
+
         if (entity1 == entity2)
             return true;
@@ -984,5 +986,5 @@
         }
 
-        TeamDeathmatch* tdm = orxonox_cast<TeamDeathmatch*>(gametype);
+        TeamGametype* tdm = orxonox_cast<TeamGametype*>(gametype);
         if (tdm)
         {
@@ -992,14 +994,4 @@
             if (entity2->getPlayer())
                 team2 = tdm->getTeam(entity2->getPlayer());
-        }
-
-        Mission* miss = orxonox_cast<Mission*>(gametype);
-        if (miss)
-        {
-            if (entity1->getPlayer())
-                team1 = miss->getTeam(entity1->getPlayer());
-
-            if (entity2->getPlayer())
-                team2 = miss->getTeam(entity2->getPlayer());
         }
 
