Index: code/branches/Asteroid_HS17/data/levels/Asteroids.oxw
===================================================================
--- code/branches/Asteroid_HS17/data/levels/Asteroids.oxw	(revision 11527)
+++ code/branches/Asteroid_HS17/data/levels/Asteroids.oxw	(revision 11528)
@@ -1,8 +1,9 @@
- <LevelInfo
+<LevelInfo
  name = "Asteroids"
- description = "Try to prevent asteroids from colliding into your spaceshuttle. Be prepared to dodge all asteroids or destroy them;"
+ description = "Try to prevent asteroids from colliding into your spaceshuttle. Be prepared to dodge all asteroids or destroy them."
  tags = "asteroids, minigame"
  screenshot = "emptylevel.png"
 />
+
 
 <?lua
@@ -14,18 +15,13 @@
   include("templates/spaceshipAssff2.oxt")
   include("templates/spaceshipPirate.oxt")
-  include("templates/spaceshipDodgeRace.oxt")
+  include("templates/spaceshipInvader.oxt")
   include("templates/enemyInvader.oxt")
-  include("templates/DodgeRacePattern.oxt")
-  include("overlays/DodgeRaceHUD.oxo")
+  include("overlays/InvaderHUD.oxo")
 ?>
 
-
-
 <Level
-    plugin = asteroids
-    gametype = Asteroids
-    >
-
-
+  plugins = invader
+  gametype = Invader
+>
   <templates>
     <Template link=lodtemplate_default />
@@ -33,41 +29,45 @@
   <?lua include("includes/notifications.oxi") ?>
 
+    <!-- ambientlight = "0.8, 0.8, 0.8"
+    skybox       = "Orxonox/Starbox" -->
   <Scene
-    ambientlight = "1.0, 1.0, 1.0"
-    skybox       = "Orxonox/skyBoxClouds"
-    negativeWorldRange = "-100000, -100000, -100000"
-    positiveWorldRange = " 100000,  100000,  100000"
+    ambientlight = "0.8, 0.7, 0.4"
+    skybox     = "Orxonox/skyBoxBasic"
   >
 
-  <WorldAmbientSound
-    source="Earth.ogg"
-    looping="true"
-    playOnLoad="true"
-  />
-
     <!-- <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/> -->
-    <Light type=directional position="-100, 10000, -700" lookat="0.2, -1, 0" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" />
-    <SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass=AsteroidsShip pawndesign=spaceshipdodgerace />
+    <Light type=directional position="1100, 11000, -7000" lookat="0, 0, 0" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" />
+    <SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass=InvaderShip pawndesign=spaceshipinvader />
 
     <DistanceTrigger name="start" position="-200,0,0" target="Pawn" distance=10 stayActive="true" delay=0 />
 
 
-    <DodgeRaceCenterPoint name=invadercenter />
-  
-  <StaticEntity position="0,-50,0" direction="0,0,0"   scale="1" collisionType=static mass=1 friction=0.01 >
+    <InvaderCenterPoint name=invadercenter />
+    
+    <?lua
+      for i = 1, 300, 1 do
+        j = math.random()
+    ?>
+
+    <MovableEntity
+      position = "<?lua print(math.random()* 40000 + 1000) ?>,-1000,<?lua print(math.random() * 4000 - 2000) ?>"
+      collisionType = dynamic
+      linearDamping = 0.8
+      angularDamping = 0
+      scale = "<?lua print(j * 150)?>"
+      collisiondamage = 0
+      enablecollisiondamage = true
+    >
       <attached>
-        <Model position="0,0,0" mesh="plane.mesh" scale3D="100000,0,100000" />
+        <Model mass="<?lua print(j * 1000) ?>" mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh" />
       </attached>
+      <collisionShapes>
+        <SphereCollisionShape radius="<?lua print(j * 350) ?>" />
+      </collisionShapes>
+    </MovableEntity>
 
-      <collisionShapes>
-        <BoxCollisionShape position="0,0,0" halfExtents="1,1,1" />
-      </collisionShapes>
-
-  </StaticEntity>
-    
-    
-    
-    
-    
+    <?lua
+      end
+    ?>
     
   </Scene>
Index: code/branches/Asteroid_HS17/src/modules/asteroids/Asteroids.cc
===================================================================
--- code/branches/Asteroid_HS17/src/modules/asteroids/Asteroids.cc	(revision 11527)
+++ code/branches/Asteroid_HS17/src/modules/asteroids/Asteroids.cc	(revision 11528)
@@ -64,6 +64,75 @@
         point = 0;
 
+        // Pre-set the timer, but don't start it yet.
+        this->enemySpawnTimer_.setTimer(5.0, true, createExecutor(createFunctor(&Asteroids::spawnStone, this)));
     }
 
+    //spawnt durch den Timer Asteroiden, denk dran, dass falls ein Asteroid stirbt er in 2 teile geteilt wird
+    Asteroids::spawnStone(){
+        if(getPlayer() == nullptr){
+            return;
+        }
+
+        AsteroidsStone* newStone;
+        newStone = new AsteroidsStone(this->center_->getContext());
+        newStone->addTemplate("asteroidsstone");
+        newStone->setAsteroidsPlayer(player);
+    }
+
+        void Invader::spawnEnemy()
+    {
+        if (getPlayer() == nullptr)
+            return;
+
+        for (int i = 0; i < (3*log10(static_cast<double>(level)) + 1); i++)
+        {
+            InvaderEnemy* newPawn;
+            if (rand() % 42/(1 + level*level) == 0)
+            {
+                newPawn = new InvaderEnemyShooter(this->center_->getContext());
+                newPawn->addTemplate("enemyinvadershooter");
+            }
+            else
+            {
+                newPawn = new InvaderEnemy(this->center_->getContext());
+                newPawn->addTemplate("enemyinvader");
+            }
+            newPawn->setInvaderPlayer(player);
+            newPawn->level = level;
+            // spawn enemy at random points in front of player.
+            newPawn->setPosition(player->getPosition() + Vector3(500.f + 100 * i, 0, float(rand())/RAND_MAX * 400 - 200));
+        }
+    }
+
+    /**
+    @brief
+        Destructor. Cleans up, if initialized.
+    */
+    Asteroids::~Asteroids()
+    {
+        if (this->isInitialized())
+            this->cleanup();
+    }
+
+    /**
+    @brief
+        Cleans up the Gametype by destroying all of the objects in the game - spaceship and asteroids.
+    */
+    void Asteroids::cleanup()
+    {
+        if (this->stones_ != nullptr) // Destroy the ball, if present.
+        {
+            this->stones_->destroy();
+            this->stones_ = nullptr;
+        }
+
+        // Destroy AsteroidsShip
+
+        if (this->player != nullptr)
+        {
+            this->player->destroy();
+            this->player = nullptr;
+        }
+    }
 
     AsteroidsShip* Asteroids::getPlayer()
@@ -87,18 +156,22 @@
         lives = 0;
     };
-
     void Asteroids::start()
     {
-        // Set variable to temporarily force the player to spawn.
-        this->bForceSpawn_ = true;
-
-        if (this->center_ == nullptr)  // abandon mission!
+        if (this->center_ == nullptr) // There needs to be a AsteroidsCenterpoint, i.e. the area the game takes place. If no centerpoint was specified, an error is thrown and the level is exited.
         {
-            orxout(internal_error) << "Invader: No Centerpoint specified." << endl;
+            orxout(internal_error) << "Asteroids: No Centerpoint specified." << endl;
             GSLevel::startMainMenu();
             return;
         }
+
+        // Set variable to temporarily force the player to spawn.
+        bool temp = this->bForceSpawn_;
+        this->bForceSpawn_ = true;
+
         // Call start for the parent class.
         Deathmatch::start();
+
+        // Reset the variable.
+        this->bForceSpawn_ = temp;
     }
 
Index: code/branches/Asteroid_HS17/src/modules/asteroids/Asteroids.h
===================================================================
--- code/branches/Asteroid_HS17/src/modules/asteroids/Asteroids.h	(revision 11527)
+++ code/branches/Asteroid_HS17/src/modules/asteroids/Asteroids.h	(revision 11528)
@@ -61,4 +61,6 @@
             void addPoints(int numPoints);
 
+            void spawnStone();
+
             int lives;
             bool bEndGame;
@@ -66,16 +68,18 @@
         private:
             void toggleShowLevel(){bShowLevel = !bShowLevel;}
+            void cleanup(void); //!< Cleans up the Gametype by destroying the ball and the bats.
             AsteroidsShip* getPlayer();
             WeakPtr<AsteroidsCenterPoint> center_;
             WeakPtr<AsteroidsShip> player;
             WeakPtr<Camera> camera;
+            WeakPtr<AsteroidsStones> stones_;
 
             Timer enemySpawnTimer;
-            Timer comboTimer;
-            Timer showLevelTimer;
             //Context* context;
             int level;
             int point;
             bool b_combo;
+
+            Timer starttimer_; //!< A timer to delay the start of the game.
     };
 }
Index: code/branches/Asteroid_HS17/src/modules/asteroids/AsteroidsCenterPoint.cc
===================================================================
--- code/branches/Asteroid_HS17/src/modules/asteroids/AsteroidsCenterPoint.cc	(revision 11527)
+++ code/branches/Asteroid_HS17/src/modules/asteroids/AsteroidsCenterPoint.cc	(revision 11528)
@@ -46,4 +46,9 @@
         RegisterObject(AsteroidsCenterPoint);
 
+
+        //Werte ausprobieren und testen!
+        this->width_ = 500;
+        this->height_= 300;
+
         this->checkGametype();
     }
Index: code/branches/Asteroid_HS17/src/modules/asteroids/AsteroidsCenterPoint.h
===================================================================
--- code/branches/Asteroid_HS17/src/modules/asteroids/AsteroidsCenterPoint.h	(revision 11527)
+++ code/branches/Asteroid_HS17/src/modules/asteroids/AsteroidsCenterPoint.h	(revision 11528)
@@ -47,6 +47,22 @@
             AsteroidsCenterPoint(Context* context); //checks whether the gametype is actually Invader.
 
+                        /**
+            @brief Set the dimensions of the playing field.
+            @param dimension A vector with the width of the playing field as first component and the height as second.
+            */
+            void setFieldDimension(const Vector2& dimension)
+                { this->width_ = dimension.x; this->height_ = dimension.y; }
+            /**
+            @brief Get the dimensions of the playing field.
+            @return Returns a vector with the width of the playing field as first component and the height as second.
+            */
+            Vector2 getFieldDimension() const
+                { return Vector2(this->width_, this->height_); }
+
         private:
             void checkGametype();
+            //Spielfeld liegt in x-z Ebene, x ist LeftRight(Horizontale), z ist UpDown (Vertikale)
+            float width_;
+            float height_;
 
     };
Index: code/branches/Asteroid_HS17/src/modules/asteroids/AsteroidsShip.cc
===================================================================
--- code/branches/Asteroid_HS17/src/modules/asteroids/AsteroidsShip.cc	(revision 11527)
+++ code/branches/Asteroid_HS17/src/modules/asteroids/AsteroidsShip.cc	(revision 11528)
@@ -5,6 +5,7 @@
 #include "Asteroids.h"
 #include "graphics/Camera.h"
-#include "asteroids/AsteroidStone"
+#include "asteroids/AsteroidStone.h"
 #include "weapons/projectiles/Projectile.h"
+#include "asteroids/AsteroidsCenterpoint.h"
 
 
@@ -108,8 +109,10 @@
 
             pos += Vector3(1000 + velocity.y, 0, velocity.x) * dt;
+
         }
 
 
-        // Camera
+
+        //Camera ticken? Bleibt eigentlich am selben Ort...irgendwo initialisieren
         Camera* camera = this->getCamera();
         if (camera != nullptr)
@@ -132,5 +135,20 @@
         SUPER(AsteroidsShip, tick, dt);
     }
-    
+
+    void AsteroidsShip::moveFrontBack(const Vector2& value)
+    {
+
+
+    } 
+
+    void AsteroidsShip::moveFrontBack(const Vector2& value)
+    {
+
+    }
+    void AsteroidsShip::moveFrontBack(const Vector2& value)
+    {
+
+    }
+
     Asteroids* AsteroidsShip::getGame()
     {
@@ -143,5 +161,5 @@
     }
 
-    void InvaderShip::death()
+    void AsteroidsShip::death()
     {
         getGame()->costLife();
Index: code/branches/Asteroid_HS17/src/modules/asteroids/AsteroidsShip.h
===================================================================
--- code/branches/Asteroid_HS17/src/modules/asteroids/AsteroidsShip.h	(revision 11527)
+++ code/branches/Asteroid_HS17/src/modules/asteroids/AsteroidsShip.h	(revision 11528)
@@ -56,4 +56,5 @@
             virtual void moveFrontBack(const Vector2& value) override;
             virtual void moveRightLeft(const Vector2& value) override;
+            virtual void moveUpDown(const Vector2& value) override;
 
             // Starts or stops fireing
@@ -61,6 +62,8 @@
 
 
-            void setCenterpoint(DodgeRaceCenterPoint* center)
+            void setCenterpoint(AsteroidsCenterPoint* center)
                        { this->center_ = center; }
+
+
             virtual void addBots(unsigned int amount) override{} //<! overwrite function in order to bypass the addbots command
 
Index: code/branches/Asteroid_HS17/src/modules/asteroids/AsteroidsStone.cc
===================================================================
--- code/branches/Asteroid_HS17/src/modules/asteroids/AsteroidsStone.cc	(revision 11527)
+++ code/branches/Asteroid_HS17/src/modules/asteroids/AsteroidsStone.cc	(revision 11528)
@@ -42,8 +42,10 @@
 {
     RegisterClass(AsteroidsStone);
-
-    AsteroidsStone::AsteroidsStone(Context* context) : MovableEntity(context)
+    //pawn kann sterben -> nach dem Tot sollen aber 2 Asteroiden spawnen
+    AsteroidsStone::AsteroidsStone(Context* context) : Pawn(context)
     {
         RegisterObject(AsteroidsStone);
+
+
 
         maxspeed = 50.0f;
Index: code/branches/Asteroid_HS17/src/modules/asteroids/AsteroidsStone.h
===================================================================
--- code/branches/Asteroid_HS17/src/modules/asteroids/AsteroidsStone.h	(revision 11527)
+++ code/branches/Asteroid_HS17/src/modules/asteroids/AsteroidsStone.h	(revision 11528)
@@ -28,6 +28,6 @@
 
 /**
-    @file InvaderEnemy.h
-    @brief Declaration of the InvaderEnemy class.
+    @file AsteroidsStone.h
+    @brief Declaration of the AsteroidsStone class.
 */
 
@@ -37,9 +37,9 @@
 #include "asteroids/AsteroidsPrereqs.h"
 
-#include "worldentities/MovableEntity.h"
+#include "worldentities/Pawn.h"
 
 namespace orxonox
 {
-    class _AsteroidsExport AsteroidsStone : public MovableEntity
+    class _AsteroidsExport AsteroidsStone : public Pawn
     {
         public:
@@ -47,16 +47,18 @@
             virtual void tick(float dt) override;
 
+            //Radius of the asteroid
             float r;
             int level;
+            virtual void setAsteroidsPlayer(AsteroidsShip* player){this->player = player;}
+
         protected:
-            float fieldWidth_;
-            float fieldHeight_;
+
+            //herausfinden->ueber Kamera Einstellung wie bei Pong?
+            float fieldWidth_=500;
+            float fieldHeight_=700;
             Vector2 velocity;
             float maxspeed;
-
-
-
     };
 }
 
-#endif /* _InvaderEnemy_H__ */
+#endif /* _AsteroidsStone_H__ */
Index: code/branches/Asteroid_HS17/src/modules/asteroids/CMakeLists.txt
===================================================================
--- code/branches/Asteroid_HS17/src/modules/asteroids/CMakeLists.txt	(revision 11527)
+++ code/branches/Asteroid_HS17/src/modules/asteroids/CMakeLists.txt	(revision 11528)
@@ -3,5 +3,5 @@
   Asteroids.cc
   AsteroidsCenterPoint.cc
-  InvaderShip.cc
+  AsteroidsShip.cc
   AsteroidsStone.cc
   AsteroidsWeapon.cc
