Index: code/branches/towerdefenseHS14/src/modules/towerdefense/TowerDefense.cc
===================================================================
--- code/branches/towerdefenseHS14/src/modules/towerdefense/TowerDefense.cc	(revision 10109)
+++ code/branches/towerdefenseHS14/src/modules/towerdefense/TowerDefense.cc	(revision 10123)
@@ -129,6 +129,8 @@
     	orxout() << "test0" << endl;
 
+
         Deathmatch::start();
 
+/*
         const int kInitialTowerCount = 3;
 
@@ -139,4 +141,5 @@
             addTower(coordinate->x, coordinate->y);
         }
+*/
 
         orxout() << "test3" << endl;
@@ -145,16 +148,26 @@
 
         TDCoordinate* coord1 = new TDCoordinate(1,1);
-        /*TDCoordinate* coord2 = new TDCoordinate(10,10);
-        TDCoordinate* coord3 = new TDCoordinate(1,2);*/
-        std::vector<TDCoordinate> path;
-        path.push_back(*coord1);
-        /*path.push_back(*coord2);
-        path.push_back(*coord3);*/
-
-        for(int i = 0 ; i <4 ; ++i)
+        TDCoordinate* coord2 = new TDCoordinate(1,1);
+        TDCoordinate* coord3 = new TDCoordinate(1,2);
+
+
+        std::vector<TDCoordinate*> path;
+
+
+        path.push_back(coord1);
+
+        path.push_back(coord2);
+
+        path.push_back(coord3);
+
+
+
+        for(int i = 0 ; i < 20 ; ++i)
         {
         	addTowerDefenseEnemy(path);
         }
 
+        orxout() << "test7" << endl;
+
         //ChatManager::message("Use the console command addTower x y to add towers");
 
@@ -162,47 +175,63 @@
     }
 
-    void TowerDefense::addTowerDefenseEnemy(std::vector<TDCoordinate> path){
+    void TowerDefense::addTowerDefenseEnemy(std::vector<TDCoordinate*> path){
 
     	orxout() << "test1" << endl;
 
     	TowerDefenseEnemy* en1 = new TowerDefenseEnemy(this->center_->getContext());
-        // Model* TowerDefenseEnemymodel = new Model(this->center_->getContext());
-        //TowerDefenseEnemymodel->setMeshSource("crate.mesh");
-        //TowerDefenseEnemymodel->setPosition(0,0,0);
-        en1->setPosition(path.at(0).get3dcoordinate());
-        //TowerDefenseEnemymodel->setScale(0.2);
-
-        //en1->attach(TowerDefenseEnemymodel);
-
-        //TowerDefenseEnemyvector.push_back(en1);
+    	en1->addTemplate("spaceshipassff");
+    	/*en1->setInitialHealth(1000);
+    	en1->setHealth(1000);
+    	en1->setMaxHealth(1000);
+    	en1->setInitialShieldHealth(1000);
+    	en1->setShieldHealth(1000);
+    	en1->setMaxShieldHealth(1000);*/
+    	orxout() << "en1 " << en1->getHealth() << endl;
+
+
+        Model* TowerDefenseEnemymodel = new Model(this->center_->getContext());
+
+        TowerDefenseEnemymodel->setMeshSource("cube.mesh");
+
+        TowerDefenseEnemymodel->setPosition(0,0,75);
+        en1->setPosition(0,0,150);
+        TowerDefenseEnemymodel->setScale(10);
+
+
+        en1->attach(TowerDefenseEnemymodel);
+
+        TowerDefenseEnemyvector.push_back(en1);
 
         orxout() << "test2" << endl;
 
-        /*for(unsigned int i = 0; i < path.size(); ++i)
-        {
-            en1->addWaypoint(path.at(i));
+        for(unsigned int i = 0; i < path.size(); ++i)
+        {
+            en1->addWaypoint((path.at(i)));
+        }
+        orxout() << "test6" << endl;
+
+
+       /* for (int i = 0; i < TowerDefenseEnemyvector.size(); ++i )
+               {
+               	orxout() <<i << " " << TowerDefenseEnemyvector.at(i)->getHealth() << endl;
+               }
+
+        WaypointController *newController = new WaypointController(en1->getContext());//
+        newController->setAccuracy(3);
+
+        for(int i =0; i < path.size(); ++i)
+        {
+
+            Model *wayPoint = new Model(en1->getContext());
+            wayPoint->setMeshSource("cube.mesh");
+            wayPoint->setPosition(path.at(i)->get3dcoordinate());
+            wayPoint->setScale(0.2);
+            newController->addWaypoint(wayPoint);
         }*/
-
-        orxout() << "test6" << endl;
-
-        /*WaypointController *newController = new WaypointController(en1);
-        newController->setAccuracy(3);
-
-        for(int i =0; i < path.size(); ++i)
-        {
-
-            Model *wayPoint = new Model(newController);
-            wayPoint->setMeshSource("crate.mesh");
-            wayPoint->setPosition(path.at(i).get3dcoordinate());
-            wayPoint->setScale(0.2);
-
-            newController->addWaypoint(wayPoint);
-
-        }*/
-
     }
 
 
     void TowerDefense::end()
+
     {
         Deathmatch::end();
@@ -214,6 +243,6 @@
 
     void TowerDefense::addTower(int x, int y)
-    {
-        /*const TowerCost towerCost = TDDefaultTowerCost;
+    {/*
+        const TowerCost towerCost = TDDefaultTowerCost;
 
         if (!this->hasEnoughCreditForTower(towerCost))
@@ -284,5 +313,12 @@
     void TowerDefense::tick(float dt)
     {
-        //SUPER(TowerDefense, tick, dt);
+        SUPER(TowerDefense, tick, dt);
+
+       /* for (int i = 0; i < TowerDefenseEnemyvector.size(); ++i )
+        {
+        	orxout() <<i << " " << TowerDefenseEnemyvector.at(i)->getHealth() << endl;
+        }
+*/
+
     }
 
