Index: code/branches/invaders/data/levels/Invaders.oxw
===================================================================
--- code/branches/invaders/data/levels/Invaders.oxw	(revision 9776)
+++ code/branches/invaders/data/levels/Invaders.oxw	(revision 9777)
@@ -16,4 +16,5 @@
   include("templates/spaceshipPirate.oxt")
   include("templates/spaceshipInvader.oxt")
+  include("templates/enemyInvader.oxt")
 ?>
 
@@ -55,16 +56,15 @@
     
     <?lua
-      for i = 1, 250, 1
-      do
-      j = math.random()
+      for i = 1, 300, 1 do
+        j = math.random()
     ?>
 
     <MovableEntity
-      position = "<?lua print(math.random()* 15000 - 1000) ?>,-1000,<?lua print(math.random() * 12000 - 4000) ?>"
+      position = "<?lua print(math.random()* 30000 - 1000) ?>,-1000,<?lua print(math.random() * 4000 - 2000) ?>"
       collisionType = dynamic
       linearDamping = 0.8
       angularDamping = 0
       scale = "<?lua print(j * 150)?>"
-      collisiondamage = 1
+      collisiondamage = 0
       enablecollisiondamage = true
     >
Index: code/branches/invaders/data/levels/templates/enemyInvader.oxt
===================================================================
--- code/branches/invaders/data/levels/templates/enemyInvader.oxt	(revision 9777)
+++ code/branches/invaders/data/levels/templates/enemyInvader.oxt	(revision 9777)
@@ -0,0 +1,113 @@
+<Template name=enemyinvader>
+  <InvaderShip
+   hudtemplate            = spaceshiphud
+   camerapositiontemplate = spaceshipescortcameras
+   spawnparticlesource    = "Orxonox/fairytwirl"
+   spawnparticleduration  = 3
+   explosionchunks        = 4
+
+   health            = 1
+   maxhealth         = 1
+   initialhealth     = 1
+
+   shieldhealth        = 35
+   initialshieldhealth = 35
+   maxshieldhealth     = 60
+   shieldabsorption    = 0.9
+   reloadrate          = 1
+   reloadwaittime      = 1
+
+   primaryThrust     = 150
+   auxilaryThrust    = 30
+   rotationThrust    = 50
+
+   lift = 1;
+   stallSpeed = 220;
+
+   boostPower            = 20
+   boostPowerRate        = 1
+   boostRate             = 5
+   boostCooldownDuration = 10
+
+   shakeFrequency = 15
+   shakeAmplitude = 6
+
+   collisionType     = "dynamic"
+   mass              = 0.00001
+   linearDamping     = 0
+   angularDamping    = 0
+  >
+    <engines>
+      <MultiStateEngine position=" 7.6, 0, 6" template=spaceshipescortengine />
+      <MultiStateEngine position="-7.6, 0, 0" template=spaceshipescortengine />
+    </engines>
+    <attached>
+      <Model position="0,0,0" yaw=90 pitch=0 roll=0 scale=8 mesh="escortShip.mesh" />
+      <Model position="0,0,0" yaw=180 pitch=90 roll=0 scale=8 mesh="escortWeapon.mesh" />
+<!--Model mesh="cube.mesh" mass=10 position="0,0,3" scale3D="10,4,8" />
+<Model mesh="cube.mesh" mass=10 position="12.6,-2,3" scale3D="2.8,2.8,11" />
+<Model mesh="cube.mesh" mass=10 position="-12.6,-2,3" scale3D="2.8,2.8,11" />
+<Model mesh="cube.mesh" mass=10 position="0,0,-12" scale3D="4,4,7" /-->
+    </attached>
+    <collisionShapes>
+      <BoxCollisionShape position="0    ,0 ,  3" halfExtents="10,   4,8" />
+      <BoxCollisionShape position="12.6 ,-2,  3" halfExtents="2.8,2.8,11"/>
+      <BoxCollisionShape position="-12.6,-2,  3" halfExtents="2.8,2.8,11"/>
+      <BoxCollisionShape position="0,     0,-12" halfExtents="4  , 4 ,7" />
+    </collisionShapes>
+<?lua
+  include("../includes/invaderWeapon.oxi")
+?>
+  </InvaderShip>
+</Template>
+
+<Template name=spaceshipescortcameras defaults=0>
+  <InvaderShip>
+    <camerapositions>
+<!--       <CameraPosition position="0,15, 60" drag=true mouselook=true />
+      <CameraPosition position="0,20, 90" drag=true mouselook=true />
+      <CameraPosition position="0,30,120" drag=true mouselook=true /> -->
+      <CameraPosition position="0,300,-100" direction="0, -1, 0" drag=false mouselook=true />
+    </camerapositions>
+  </InvaderShip>
+</Template>
+
+<Template name=spaceshipescortengine baseclass=MultiStateEngine>
+  <MultiStateEngine
+   boostfactor    = 2.2
+
+   speedfront     = 200
+   speedback      =  70
+   speedleftright =  70
+   speedupdown    =  70
+
+   defEngineSndNormal = "sounds/Engine_low.ogg"
+   defEngineSndBoost = "sounds/Engine_high.ogg"
+
+   accelerationfront     = 700
+   accelerationbrake     = 700
+   accelerationback      =  125
+   accelerationleftright =  125
+   accelerationupdown    =  125
+  >
+    <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.09 position="12, -2, 13" colour="0.2, 1.0, 0.65, 1.0" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
+      <FadingBillboard mainstate=activity active=false scale=0.09 position="-12, -2, 13" colour="0.2, 1.0, 0.65, 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.33 name=bltest position=" 12, 0, 10" colour="0.2, 1.0, 0.65, 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.33 name=bltest position="-12, 0, 10" colour="0.2, 1.0, 0.65, 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.33 name=bltest position=" 12, 0, 10" colour="0.6, 0.8, 0.75, 0.7" width=25 length=1000 lifetime=1 elements=30 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Examples/Flare" />
+      <Backlight mainstate=activity active=false scale=0.33 name=bltest position="-12, 0, 10" colour="0.6, 0.8, 0.75, 0.7" width=25 length=1000 lifetime=1 elements=30 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Examples/Flare" />
+    </EffectContainer>
+
+  </MultiStateEngine>
+</Template>
Index: code/branches/invaders/src/modules/invader/CMakeLists.txt
===================================================================
--- code/branches/invaders/src/modules/invader/CMakeLists.txt	(revision 9776)
+++ code/branches/invaders/src/modules/invader/CMakeLists.txt	(revision 9777)
@@ -4,4 +4,5 @@
   InvaderCenterPoint.cc
   InvaderShip.cc
+  InvaderEnemy.cc
   InvaderWeapon.cc
 END_BUILD_UNIT
Index: code/branches/invaders/src/modules/invader/Invader.cc
===================================================================
--- code/branches/invaders/src/modules/invader/Invader.cc	(revision 9776)
+++ code/branches/invaders/src/modules/invader/Invader.cc	(revision 9777)
@@ -42,9 +42,11 @@
 #include "chat/ChatManager.h"
 
-#include "InvaderShip.h"
 // ! HACK
 #include "infos/PlayerInfo.h"
 
 #include "InvaderCenterPoint.h"
+#include "InvaderShip.h"
+
+#include "core/command/ConsoleCommand.h"
 
 namespace orxonox
@@ -55,11 +57,30 @@
     {
         RegisterObject(Invader);
+        this->center_ = 0;
 
-        this->center_ = 0;
+        this->console_addEnemy = createConsoleCommand( "spawnEnemy", createExecutor( createFunctor(&Invader::spawnEnemy, this) ) );
         //this->context = context;
+
+        enemySpawnTimer.setTimer(2.0f, true, createExecutor(createFunctor(&Invader::spawnEnemy, this)));
     }
 
     Invader::~Invader()
     {
+    }
+
+    void Invader::spawnEnemy()
+    {
+        if (player == NULL)
+        {
+            for (ObjectList<InvaderShip>::iterator it = ObjectList<InvaderShip>::begin(); it != ObjectList<InvaderShip>::end(); ++it)
+                player = *it;
+        }
+        if (player == NULL)
+            return;
+
+        Pawn* newPawn = new Pawn(this->center_->getContext());
+        newPawn->addTemplate("enemyinvader");
+
+        newPawn->setPosition(player->getPosition() + Vector3(1000, 0, 0));
     }
 
Index: code/branches/invaders/src/modules/invader/Invader.h
===================================================================
--- code/branches/invaders/src/modules/invader/Invader.h	(revision 9776)
+++ code/branches/invaders/src/modules/invader/Invader.h	(revision 9777)
@@ -42,4 +42,6 @@
 #include "InvaderCenterPoint.h"
 
+#include "tools/Timer.h"
+
 namespace orxonox
 {
@@ -56,8 +58,15 @@
             //virtual void spawnPlayer(PlayerInfo* player); //!< Spawns the input player.
 
+            void spawnEnemy();
+
             void setCenterpoint(InvaderCenterPoint* center)
             { this->center_ = center; }
         private:
             WeakPtr<InvaderCenterPoint> center_;
+            InvaderShip * player;
+
+            ConsoleCommand* console_addEnemy;
+
+            Timer enemySpawnTimer;
             //Context* context;
     };
Index: code/branches/invaders/src/modules/invader/InvaderEnemy
===================================================================
--- code/branches/invaders/src/modules/invader/InvaderEnemy	(revision 9777)
+++ code/branches/invaders/src/modules/invader/InvaderEnemy	(revision 9777)
@@ -0,0 +1,65 @@
+/*
+ *   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:
+ *      Florian Zinggeler
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file InvaderEnemy.h
+    @brief Declaration of the InvaderEnemy class.
+*/
+
+#ifndef _InvaderEnemy_H__
+#define _InvaderEnemy_H__
+
+#include "invader/InvaderPrereqs.h"
+
+#include "worldentities/pawns/SpaceShip.h"
+
+namespace orxonox
+{
+    class _InvaderExport InvaderEnemy : public SpaceShip
+    {
+        public:
+            InvaderEnemy(Context* context); //!< Constructor. Registers and initializes the object.
+            virtual ~InvaderEnemy() {}
+
+            virtual void tick(float dt);
+
+        private:
+            Camera* camera;
+            bool isFireing;
+            float speed, damping;
+            float lastTimeFront, lastTimeLeft;
+            struct Velocity
+            {
+                float x;
+                float y;
+            } velocity, desiredVelocity;
+
+    };
+}
+
+#endif /* _InvaderEnemy_H__ */
Index: code/branches/invaders/src/modules/invader/InvaderPrereqs.h
===================================================================
--- code/branches/invaders/src/modules/invader/InvaderPrereqs.h	(revision 9776)
+++ code/branches/invaders/src/modules/invader/InvaderPrereqs.h	(revision 9777)
@@ -71,4 +71,5 @@
     class InvaderCenterPoint;
     class InvaderShip;
+    class InvaderEnemy;
     class InvaderWeapon;
 }
Index: code/branches/invaders/src/modules/invader/InvaderShip.cc
===================================================================
--- code/branches/invaders/src/modules/invader/InvaderShip.cc	(revision 9776)
+++ code/branches/invaders/src/modules/invader/InvaderShip.cc	(revision 9777)
@@ -52,5 +52,4 @@
         isFireing = false;
         damping = 10;
-
     }
 
@@ -75,4 +74,15 @@
             ControllableEntity::fire(0);
 
+        if (getPosition().x > 30000)
+        {
+            //level++
+            setPosition(getPosition() - Vector3(30000, 0, 0));
+        }
+
+        // if ((int(getPosition().x) % 1000) < 5)
+        // {
+        //     for (ObjectList<Invader>::iterator it = ObjectList<Invader>::begin(); it != ObjectList<Invader>::end(); ++it)
+        //         it->spawnEnemy();
+        // }
 
         // camera->setOrientation(Vector3::UNIT_X, Degree(0));
@@ -81,4 +91,6 @@
         SUPER(InvaderShip, tick, dt);
     }
+
+
 
     void InvaderShip::moveFrontBack(const Vector2& value)
Index: code/branches/invaders/src/modules/invader/InvaderShip.h
===================================================================
--- code/branches/invaders/src/modules/invader/InvaderShip.h	(revision 9776)
+++ code/branches/invaders/src/modules/invader/InvaderShip.h	(revision 9777)
@@ -59,4 +59,6 @@
             virtual void rotatePitch(const Vector2& value){};
             virtual void rotateRoll(const Vector2& value){};
+
+            // *InvaderShip getShip(){return this;}
         private:
             Camera* camera;
