Index: /code/branches/towerdefenseHS14/data/levels/templates/TowerdefenseEnemy.oxt
===================================================================
--- /code/branches/towerdefenseHS14/data/levels/templates/TowerdefenseEnemy.oxt	(revision 10123)
+++ /code/branches/towerdefenseHS14/data/levels/templates/TowerdefenseEnemy.oxt	(revision 10123)
@@ -0,0 +1,84 @@
+<Template name=TowerdefenseEnemy>
+  <TowerdefenseEnemy
+   hudtemplate            = spaceshiphud
+   camerapositiontemplate = TowerdefenseEnemycameras
+   spawnparticlesource    = "Orxonox/fairytwirl"
+   spawnparticleduration  = 3
+   explosionchunks        = 6
+
+   health            = 100
+   maxhealth         = 200
+   initialhealth     = 100
+
+   primaryThrust     = 100
+   auxilaryThrust    = 30
+   rotationThrust    = 50
+
+
+   shakeFrequency = 15
+   shakeAmplitude = 9
+
+   collisionType     = "dynamic"
+   mass              = 100
+   linearDamping     = 0.7
+   angularDamping    = 0.9999999
+
+   explosionSound = "sounds/Explosion2.ogg"
+  >
+    <engines>
+      <MultiStateEngine position=" 7.6, 0, 6" template=TowerdefenseEnemyengine />
+      <MultiStateEngine position="-7.6, 0, 0" template=TowerdefenseEnemyengine />
+    </engines>
+    <attached>
+      <Model position="0,0,0" yaw=90 pitch=-90 roll=0 scale=4 mesh="assff.mesh" />
+      <BlinkingBillboard position="17,-1.5,0" material="Examples/Flare" colour="1.0, 0.5, 0.3" amplitude=0.1 frequency=0.5 quadratic=1 />
+      <BlinkingBillboard position="-17,-1.5,0" material="Examples/Flare" colour="0.5, 1.0, 0.3" amplitude=0.1 frequency=0.5 phase=180 quadratic=1 />
+    </attached>
+    <collisionShapes>
+      <BoxCollisionShape position="0,0,0"      halfExtents="10, 3, 5" />
+      <BoxCollisionShape position="13,-1.3,0"  halfExtents="3, 1, 2" />
+      <BoxCollisionShape position="-13,-1.3,0" halfExtents="3, 1, 2" />
+      <BoxCollisionShape position="0,0,7"      halfExtents="3, 2, 2" />
+      <BoxCollisionShape position="0,0.1,-11"  halfExtents="2.2, 1.8, 6" />
+      <BoxCollisionShape position="0,0.1,-19"  halfExtents="1.4, 1, 2" />
+  </TowerdefenseEnemy>
+</Template>
+
+<Template name=TowerdefenseEnemycameras defaults=0>
+  <TowerdefenseEnemy>
+    <camerapositions>
+      <CameraPosition position="0,10, 40" drag=true mouselook=true />
+      <CameraPosition position="0,20, 80" drag=true mouselook=true />
+      <CameraPosition position="0,30,120" drag=true mouselook=true />
+    </camerapositions>
+  </TowerdefenseEnemy>
+</Template>
+
+
+    <EffectContainer condition="idle">
+      <WorldSound mainstate="activity" source="sounds/Engine_idle.ogg" looping=1 active=false/>
+    </EffectContainer>
+    <EffectContainer condition="not idle">
+      <FadingBillboard mainstate=activity active=false scale=0.1 position="7.6, 0, 9" colour="0.2, 0.65, 1.0, 1.0" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
+      <FadingBillboard mainstate=activity active=false scale=0.1 position="-7.6, 0, 9" colour="0.2, 0.65, 1.0, 1.0" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
+    </EffectContainer>
+    <EffectContainer condition="normal or brake">
+
+    </EffectContainer>
+    <EffectContainer condition="normal or boost">
+      <Backlight mainstate=activity active=false scale=0.4 name=bltest position=" 7.6, 0, 6" colour="0.2, 0.65, 1.0, 1.0" width=15 length=1500 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" />
+      <Backlight mainstate=activity active=false scale=0.4 name=bltest position="-7.6, 0, 6" colour="0.2, 0.65, 1.0, 1.0" width=15 length=1500 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" />
+    </EffectContainer>
+    <EffectContainer condition="boost">
+      <Backlight mainstate=activity active=false scale=0.4 name=bltest position=" 7.6, 0, 6" colour="0.6, 0.75, 0.8, 0.7" width=40 length=1000 lifetime=1 elements=30 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Examples/Flare" />
+      <Backlight mainstate=activity active=false scale=0.4 name=bltest position="-7.6, 0, 6" colour="0.6, 0.75, 0.8, 0.7" width=40 length=1000 lifetime=1 elements=30 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Examples/Flare" />
+    </EffectContainer>
+<!--    <EffectContainer condition="brake">
+      <FadingBillboard mainstate=activity active=false scale=0.3 position=" 8, 0, 6" colour="0.5, 0.0, 0.0, 0.3" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
+      <FadingBillboard mainstate=activity active=false scale=0.3 position="-8, 0, 6" colour="0.5, 0.0, 0.0, 0.3" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
+      <FadingBillboard mainstate=activity active=false scale=0.15 position=" 8, 0, 6" colour="1.0, 0.0, 0.0, 1.0" material="Flares/backlightflare" turnontime=0.5 turnofftime=0.5 />
+      <FadingBillboard mainstate=activity active=false scale=0.15 position="-8, 0, 6" colour="1.0, 0.0, 0.0, 1.0" material="Flares/backlightflare" turnontime=0.5 turnofftime=0.5 />
+    </EffectContainer>
+-->
+  </MultiStateEngine>
+</Template>
Index: /code/branches/towerdefenseHS14/src/modules/towerdefense/TowerDefense.cc
===================================================================
--- /code/branches/towerdefenseHS14/src/modules/towerdefense/TowerDefense.cc	(revision 10122)
+++ /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;
+        }
+*/
+
     }
 
Index: /code/branches/towerdefenseHS14/src/modules/towerdefense/TowerDefense.h
===================================================================
--- /code/branches/towerdefenseHS14/src/modules/towerdefense/TowerDefense.h	(revision 10122)
+++ /code/branches/towerdefenseHS14/src/modules/towerdefense/TowerDefense.h	(revision 10123)
@@ -56,5 +56,5 @@
         std::vector<TowerDefenseEnemy*> TowerDefenseEnemyvector;
 
-        void addTowerDefenseEnemy(std::vector<TDCoordinate> path);
+        void addTowerDefenseEnemy(std::vector<TDCoordinate*> path);
         virtual void start(); //<! The function is called when the gametype starts
         virtual void end();
Index: /code/branches/towerdefenseHS14/src/modules/towerdefense/TowerDefenseEnemy.cc
===================================================================
--- /code/branches/towerdefenseHS14/src/modules/towerdefense/TowerDefenseEnemy.cc	(revision 10122)
+++ /code/branches/towerdefenseHS14/src/modules/towerdefense/TowerDefenseEnemy.cc	(revision 10123)
@@ -32,5 +32,5 @@
     }
 
-    void TowerDefenseEnemy::addWaypoint(TDCoordinate coord)
+    void TowerDefenseEnemy::addWaypoint(TDCoordinate* coord)
     {
     	orxout() << "test4" << endl;
@@ -38,5 +38,5 @@
     	orxout() << "test5" << endl;
     }
-
+/*
     void TowerDefenseEnemy::popWaypoint()
     {
@@ -48,5 +48,5 @@
     {
     	if(Waypointsvector_.size()<=0){
-    		TDCoordinate coord = TDCoordinate(-1,-1);
+    		TDCoordinate* coord = TDCoordinate(-1,-1);
     		return coord;
     	}else{
@@ -57,4 +57,4 @@
 
     }
-
+*/
 }
Index: /code/branches/towerdefenseHS14/src/modules/towerdefense/TowerDefenseEnemy.h
===================================================================
--- /code/branches/towerdefenseHS14/src/modules/towerdefense/TowerDefenseEnemy.h	(revision 10122)
+++ /code/branches/towerdefenseHS14/src/modules/towerdefense/TowerDefenseEnemy.h	(revision 10123)
@@ -38,10 +38,10 @@
         //health gibt es unter: health_
 
-        void addWaypoint(TDCoordinate coord);
+        void addWaypoint(TDCoordinate* coord);
         void popWaypoint();
         TDCoordinate peekWaypoint();
 	private:
 
-        std::vector<TDCoordinate> Waypointsvector_;
+        std::vector<TDCoordinate*> Waypointsvector_;
 
 	};
