Index: code/branches/towerdefenseFS15/data/levels/towerDefense.oxw
===================================================================
--- code/branches/towerdefenseFS15/data/levels/towerDefense.oxw	(revision 10408)
+++ code/branches/towerdefenseFS15/data/levels/towerDefense.oxw	(revision 10430)
@@ -37,5 +37,5 @@
   <TowerDefenseSelecter team=0 camerapositiontemplate=selectercameras>
     <attached>
-      <Model position="0,0,0" mesh="cube.mesh" scale=45 />
+      <Model pitch=90 position="0,0,-30" mesh="TD_Selection.mesh" scale=30 />
     </attached>
   </TowerDefenseSelecter>
Index: code/branches/towerdefenseFS15/src/modules/objects/controllers/TurretController.cc
===================================================================
--- code/branches/towerdefenseFS15/src/modules/objects/controllers/TurretController.cc	(revision 10408)
+++ code/branches/towerdefenseFS15/src/modules/objects/controllers/TurretController.cc	(revision 10430)
@@ -196,7 +196,5 @@
             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/TowerDefense.cc
===================================================================
--- code/branches/towerdefenseFS15/src/modules/towerdefense/TowerDefense.cc	(revision 10408)
+++ code/branches/towerdefenseFS15/src/modules/towerdefense/TowerDefense.cc	(revision 10430)
@@ -86,4 +86,5 @@
 /* Part of a temporary hack to allow the player to add towers */
 #include "core/command/ConsoleCommand.h"
+#include <cmath>
 
 
@@ -92,4 +93,7 @@
     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;
+
 
     SetConsoleCommand("TowerDefense", __CC_addTower_name,  &TowerDefense::addTower ).addShortcut().defaultValues(1);
@@ -119,4 +123,8 @@
         this->lifes_ = 0;
         this->timeSetTower_ = 0;
+        spaceships =15;
+        eggs=3;
+        ufos=7;
+        randomships=5;
 
 
@@ -199,5 +207,5 @@
 
         //set initial credits, lifes and WaveNumber
-        this->setCredit(1000);
+        this->setCredit(100);
         this->setLifes(100);
         this->setWaveNumber(0);
@@ -223,4 +231,5 @@
             en1->addTemplate("enemytowerdefense1");
             en1->setScale(3);
+            en1->lookAt(Vector3(0,0,100000));
             en1->setHealth(en1->getHealth() +50 + this->getWaveNumber()*4);
             break;
@@ -229,4 +238,6 @@
             en1->addTemplate("enemytowerdefense2");
             en1->setScale(2);
+            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))
@@ -236,4 +247,6 @@
             en1->addTemplate("enemytowerdefense3");
             en1->setScale(1);
+            en1->lookAt(Vector3(0,0,100000));
+            en1->roll(Degree(120));
             en1->setHealth(en1->getHealth() -10 + this->getWaveNumber()*4);
             break;
@@ -291,5 +304,4 @@
         y = coord->GetY();
         
-        const int upgradeCost = 20;
 
         if (!this->hasEnoughCreditForTower(upgradeCost))
@@ -311,4 +323,22 @@
         {
             (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);
         }
@@ -325,5 +355,4 @@
         y = coord->GetY();
 
-        const int towerCost = 20;
 
         if (!this->hasEnoughCreditForTower(towerCost))
@@ -359,7 +388,8 @@
         //Create Model
         Model* newTowerModel = new Model(this->center_->getContext());
-        newTowerModel->setMeshSource("Tower.mesh");
-        newTowerModel->setScale(45);
-        newTowerModel->setPosition(static_cast<float>((x-8) * tileScale), static_cast<float>((y-8) * tileScale), 50);
+        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
@@ -387,4 +417,26 @@
 
  
+    void TowerDefense::nextwave()
+    {
+    	TowerDefenseEnemyvector.clear();
+    	waves_++;
+    	time=0;
+        float randomnumber1 = rand()*100*5;
+        float randomnumber2 = rand()*100*1;
+        float randomnumber3 = rand()*100*1.5;
+
+        float totalnumber = (randomnumber1 + randomnumber2 + randomnumber3)*1.3;
+
+        int newspaceships = (int)(maxspaceships* randomnumber1 / totalnumber);
+        int neweggs = (int)(maxspaceships*randomnumber2 / totalnumber);
+        int newufos = (int)(maxspaceships*randomnumber3 / totalnumber);
+        int newrandomships = maxspaceships -spaceships - eggs - ufos;
+        int spaceships =newspaceships;
+        int eggs=neweggs;
+        int ufos=newufos;
+        int randomships=newrandomships;
+
+    }
+
     void TowerDefense::tick(float dt)
     {
@@ -392,5 +444,4 @@
         time +=dt;
         timeSetTower_ +=dt;
-        orxout() << dt << "time" << endl;
 
         //Check if tower has to be set (because TowerDefenseSelecter asks for it)
@@ -401,19 +452,42 @@
 			{
 
-				int xcoord = selecter->selectedPos_->GetX();
-				int ycoord = selecter->selectedPos_->GetY();
+				int x = selecter->selectedPos_->GetX();
+				int y = selecter->selectedPos_->GetY();
 				Model* dummyModel2 = new Model(this->center_->getContext());
 
 
 
-				if(towerModelMatrix[xcoord][ycoord] == NULL)
+				if(towerModelMatrix[x][y] == NULL)
 				{
-					addTower(xcoord,ycoord);
+					addTower(x,y);
 				}
 				else
 				{
-					if(!((towerModelMatrix [xcoord][ycoord])->getMeshSource() == dummyModel2->getMeshSource()))
+					if(!((towerModelMatrix [x][y])->getMeshSource() == dummyModel2->getMeshSource()))
 					{
-						towerTurretMatrix[xcoord][ycoord]->upgradeTower();
+						towerTurretMatrix[x][y]->upgradeTower();
+				        if(towerTurretMatrix[x][y]->upgrade < towerTurretMatrix[x][y]->upgradeMax)
+				        {
+				        	this->buyTower((int)(upgradeCost*(std::pow(1.5,towerTurretMatrix[x][y]->upgrade))));
+							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;
+
+						   }
+
+
+				        }
 					}
 				}
@@ -429,18 +503,29 @@
         int enemytype = this->getWaveNumber() % 3 +1;
 
-        float randomnumber1 = rand()*100*5;
-        float randomnumber2 = rand()*100*1;
-        float randomnumber3 = rand()*100*1.5;
-
-        float totalnumber = randomnumber1 + randomnumber2 + randomnumber3;
-        int maxspaceships = 30;
-        int spaceships = (int)(maxspaceships* randomnumber1 / totalnumber);
-        int eggs = (int)(maxspaceships*randomnumber2 / totalnumber);
-        int ufos = (int)(maxspaceships*randomnumber3 / totalnumber);
 
         if(time>=TowerDefenseEnemyvector.size() && TowerDefenseEnemyvector.size() < maxspaceships)
 		{
-			//adds different types of enemys depending on the WaveNumber
-			addTowerDefenseEnemy(path, enemytype);
+			orxout() << "enemyerstellen" << endl;
+        	//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--;
+
+        	}
+
 		}
 
@@ -497,4 +582,5 @@
     }
 
+
     // Function to test if we can add waypoints using code only. Doesn't work yet
 
Index: code/branches/towerdefenseFS15/src/modules/towerdefense/TowerDefense.h
===================================================================
--- code/branches/towerdefenseFS15/src/modules/towerdefense/TowerDefense.h	(revision 10408)
+++ code/branches/towerdefenseFS15/src/modules/towerdefense/TowerDefense.h	(revision 10430)
@@ -73,7 +73,13 @@
         void buyTower(int cost){ credit_ -= cost;}
         void addCredit(int credit) { credit_+=credit; }
-        void nextwave(){ TowerDefenseEnemyvector.clear(); waves_++; time=0;}
+        void nextwave();
         int reduceLifes(int NumberofLifes){ return lifes_-=NumberofLifes; }
         TowerDefenseSelecter* selecter;
+        int spaceships;
+        int eggs;
+        int ufos;
+        int randomships;
+        int maxspaceships = 30;
+
 
         //virtual void pawnKilled(Pawn* victim, Pawn* killer = 0);
Index: code/branches/towerdefenseFS15/src/modules/towerdefense/TowerDefenseTower.cc
===================================================================
--- code/branches/towerdefenseFS15/src/modules/towerdefense/TowerDefenseTower.cc	(revision 10408)
+++ code/branches/towerdefenseFS15/src/modules/towerdefense/TowerDefenseTower.cc	(revision 10430)
@@ -30,4 +30,5 @@
         this->addTemplate("towerdefensetower");
 
+        upgradeMax = 5;
 
 
@@ -61,5 +62,5 @@
     bool TowerDefenseTower::upgradeTower()
     {
-        if(upgrade < 3)
+        if(upgrade < upgradeMax)
         {
             upgrade++;
Index: code/branches/towerdefenseFS15/src/modules/towerdefense/TowerDefenseTower.h
===================================================================
--- code/branches/towerdefenseFS15/src/modules/towerdefense/TowerDefenseTower.h	(revision 10408)
+++ code/branches/towerdefenseFS15/src/modules/towerdefense/TowerDefenseTower.h	(revision 10430)
@@ -49,7 +49,9 @@
         void setGame(TowerDefense* Towerdefense)
         { assert(Towerdefense); game_ = Towerdefense; }
+        int upgrade;
+        int upgradeMax;
     private:
         TowerDefense* game_;
-        int upgrade;
+
     };
 }
