Index: /code/branches/towerdefenseFS15/data/levels/towerDefense.oxw
===================================================================
--- /code/branches/towerdefenseFS15/data/levels/towerDefense.oxw	(revision 10367)
+++ /code/branches/towerdefenseFS15/data/levels/towerDefense.oxw	(revision 10368)
@@ -29,5 +29,5 @@
   <Pawn team=1>
     <camerapositions>
-      <CameraPosition position="-2000,0,1500"/>
+      <CameraPosition position="0,0,1500"/>
     </camerapositions>
   </Pawn>
@@ -59,5 +59,5 @@
 
     <!-- Spawns the camera, attached to a crate -->
-    <SpawnPoint team=1 position="2000,0,0" pawndesign=centerpointmark />
+    <SpawnPoint team=1 position="0,0,0" pawndesign=centerpointmark />
     <!--TeamSpawnPoint team=1 position="-7,7,4" direction="-1,0,0" roll=90 yaw=0 spawnclass=SpaceShip pawndesign=spaceshipassff /-->
 
Index: /code/branches/towerdefenseFS15/src/modules/objects/controllers/TurretController.cc
===================================================================
--- /code/branches/towerdefenseFS15/src/modules/objects/controllers/TurretController.cc	(revision 10367)
+++ /code/branches/towerdefenseFS15/src/modules/objects/controllers/TurretController.cc	(revision 10368)
@@ -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,7 @@
             if(this->isLookingAtTargetNew(Degree(5).valueRadians()))
             {
+            	orxout() << target_->getIdentifier()->getName() << " / " << target_->getWorldPosition() << " / " << target_->getHealth() << " / " << target_->getTeam() << " / " << this->getTeam() << " / " << turret->getTeam() << endl;
+            	if (target_->getController())
+            		orxout() << target_->getController()->getIdentifier()->getName() << " / " << target_->getController()->getTeam() << endl;
                 this->getControllableEntity()->fire(0);
             }
Index: /code/branches/towerdefenseFS15/src/modules/towerdefense/CMakeLists.txt
===================================================================
--- /code/branches/towerdefenseFS15/src/modules/towerdefense/CMakeLists.txt	(revision 10367)
+++ /code/branches/towerdefenseFS15/src/modules/towerdefense/CMakeLists.txt	(revision 10368)
@@ -7,4 +7,5 @@
   TDCoordinate.cc
   TowerDefenseEnemy.cc
+ # TowerDefenseSelecter.cc
 
 )
Index: /code/branches/towerdefenseFS15/src/modules/towerdefense/TowerDefense.cc
===================================================================
--- /code/branches/towerdefenseFS15/src/modules/towerdefense/TowerDefense.cc	(revision 10367)
+++ /code/branches/towerdefenseFS15/src/modules/towerdefense/TowerDefense.cc	(revision 10368)
@@ -98,5 +98,5 @@
     RegisterUnloadableClass(TowerDefense);
 
-    TowerDefense::TowerDefense(Context* context) : Deathmatch(context)
+    TowerDefense::TowerDefense(Context* context) : TeamDeathmatch(context)
     {
         RegisterObject(TowerDefense);
@@ -108,7 +108,15 @@
         }*/
 
+        selectedPos = new TDCoordinate(0,0);
+//        TowerDefenseSelecter Selecter = new TowerDefenseSelecter();
 
 
         this->setHUDTemplate("TowerDefenseHUD");
+        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->stats_ = new TowerDefensePlayerStats();
@@ -138,5 +146,5 @@
     {
 
-        Deathmatch::start();
+        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
@@ -220,5 +228,5 @@
     {
 
-        Deathmatch::end();
+        TeamDeathmatch::end();
         ChatManager::message("Match is over! Gameover!");
 
@@ -330,9 +338,8 @@
         std::vector<TDCoordinate*> path;
         path.push_back(coord1);
-        if(time>1 && TowerDefenseEnemyvector.size() < 30)
+        if(time>=TowerDefenseEnemyvector.size() && TowerDefenseEnemyvector.size() < 30)
         {
             //adds different types of enemys depending on the WaveNumber
             addTowerDefenseEnemy(path, this->getWaveNumber() % 3 +1 );
-            time = time-1;
         }
 
@@ -359,4 +366,5 @@
             }
         }
+
         //goes thorugh vector to see if an enemy is still alive. if not next wave is launched
         int count= 0;
@@ -369,7 +377,10 @@
         }
 
+        if (count == 0 && !this->nextwaveTimer_.isActive())
+            this->nextwaveTimer_.startTimer();
+
+/*            time2 +=dt;
         if(count== 0)
         {
-            time2 +=dt;
             if(time2 > 10)
             {
@@ -380,5 +391,5 @@
             }
         }
-
+*/
 
     }
@@ -425,5 +436,5 @@
     void TowerDefense::playerEntered(PlayerInfo* player)
     {
-        Deathmatch::playerEntered(player);
+        TeamDeathmatch::playerEntered(player);
 
         const std::string& message = player->getName() + " entered the game";
@@ -433,5 +444,5 @@
     bool TowerDefense::playerLeft(PlayerInfo* player)
     {
-        bool valid_player = Deathmatch::playerLeft(player);
+        bool valid_player = TeamDeathmatch::playerLeft(player);
 
         if (valid_player)
@@ -463,5 +474,5 @@
         }
 
-        Deathmatch::pawnKilled(victim, killer);
+        TeamDeathmatch::pawnKilled(victim, killer);
     }
 
Index: /code/branches/towerdefenseFS15/src/modules/towerdefense/TowerDefense.h
===================================================================
--- /code/branches/towerdefenseFS15/src/modules/towerdefense/TowerDefense.h	(revision 10367)
+++ /code/branches/towerdefenseFS15/src/modules/towerdefense/TowerDefense.h	(revision 10368)
@@ -39,5 +39,5 @@
 #include "TDCoordinate.h"
 #include "towerdefense/TowerDefensePrereqs.h"
-#include "gametypes/Deathmatch.h"
+#include "gametypes/TeamDeathmatch.h"
 #include "TowerDefenseEnemy.h"
 #include "util/Output.h"
@@ -46,5 +46,5 @@
 namespace orxonox
 {
-    class _TowerDefenseExport TowerDefense : public Deathmatch
+    class _TowerDefenseExport TowerDefense : public TeamDeathmatch
     {
     public:
@@ -70,6 +70,7 @@
         void buyTower(int cost){ credit_ -= cost;}
         void addCredit(int credit) { credit_+=credit; }
-        void nextwave(){ waves_++;}
+        void nextwave(){ TowerDefenseEnemyvector.clear(); waves_++; time=0;}
         int reduceLifes(int NumberofLifes){ return lifes_-=NumberofLifes; }
+        TDCoordinate* selectedPos;
 
         //virtual void pawnKilled(Pawn* victim, Pawn* killer = 0);
@@ -95,8 +96,9 @@
         TowerDefenseCenterpoint *center_;
         float time;
-        float time2;
+//        float time2;
         int credit_;
         int waves_;
         int lifes_;
+        Timer nextwaveTimer_;
 
         /* handles stats */
Index: /code/branches/towerdefenseFS15/src/orxonox/controllers/FormationController.cc
===================================================================
--- /code/branches/towerdefenseFS15/src/orxonox/controllers/FormationController.cc	(revision 10367)
+++ /code/branches/towerdefenseFS15/src/orxonox/controllers/FormationController.cc	(revision 10368)
@@ -987,5 +987,5 @@
         }
 
-        TeamDeathmatch* tdm = orxonox_cast<TeamDeathmatch*>(gametype);
+        TeamGametype* tdm = orxonox_cast<TeamGametype*>(gametype);
         if (tdm)
         {
@@ -995,14 +995,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());
         }
 
