Index: code/branches/Asteroid_HS17/src/modules/asteroids/Asteroids.cc
===================================================================
--- code/branches/Asteroid_HS17/src/modules/asteroids/Asteroids.cc	(revision 11541)
+++ code/branches/Asteroid_HS17/src/modules/asteroids/Asteroids.cc	(revision 11555)
@@ -60,4 +60,5 @@
         this->numberOfBots_ = 0; //sets number of default bots temporarly to 0
         this->center_ = nullptr;
+        this->lives = 3;
         bEndGame = false;
         lives = 3;
@@ -65,5 +66,5 @@
 
         // Pre-set the timer, but don't start it yet.
-        this->enemySpawnTimer_.setTimer(5.0, true, createExecutor(createFunctor(&Asteroids::spawnStone, this)));
+        //this->enemySpawnTimer_.setTimer(5.0, true, createExecutor(createFunctor(&Asteroids::spawnStone, this)));
     }
 
@@ -79,33 +80,18 @@
     }
 
-    /**
-    @brief
-        Destructor. Cleans up, if initialized.
-    */
-    Asteroids::~Asteroids()
+    void Asteroids::spawnStone(int newsize)
     {
-        if (this->isInitialized())
-            this->cleanup();
-    }
+        //no player -> should end game?
+        if(getPlayer() == nullptr) return;
+        //invalid size
+        if(newsize > 3 || newsize < 1) return;
+        AsteroidsStone* newStone;
+        newStone = new AsteroidsStone(this->center_->getContext());
+        newStone.size = newsize;
+        if(newsize == 1) newStone->addTemplate("asteroidsstone1");
+        else if(newsize == 2) newStone->addTemplate("asteroidsstone2");
+        else newStone->addTemplate("asteroidsstone3");
+        newStone->setAsteroidsPlayer(player);
 
-    /**
-    @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;
-        }
     }
 
Index: code/branches/Asteroid_HS17/src/modules/asteroids/Asteroids.h
===================================================================
--- code/branches/Asteroid_HS17/src/modules/asteroids/Asteroids.h	(revision 11541)
+++ code/branches/Asteroid_HS17/src/modules/asteroids/Asteroids.h	(revision 11555)
@@ -67,6 +67,4 @@
             
         private:
-            void toggleShowLevel(){bShowLevel = !bShowLevel;}
-            void cleanup(void); //!< Cleans up the Gametype by destroying the ball and the bats.
             AsteroidsShip* getPlayer();
             WeakPtr<AsteroidsCenterPoint> center_;
@@ -75,11 +73,11 @@
             WeakPtr<AsteroidsStones> stones_;
 
-            Timer enemySpawnTimer;
+
             //Context* context;
-            int level;
+            int lives;
             int point;
-            bool b_combo;
 
             Timer starttimer_; //!< A timer to delay the start of the game.
+            Timer enemySpawnTimer;
     };
 }
Index: code/branches/Asteroid_HS17/src/modules/asteroids/AsteroidsShip.cc
===================================================================
--- code/branches/Asteroid_HS17/src/modules/asteroids/AsteroidsShip.cc	(revision 11541)
+++ code/branches/Asteroid_HS17/src/modules/asteroids/AsteroidsShip.cc	(revision 11555)
@@ -19,7 +19,5 @@
         RegisterObject(AsteroidsShip);
 
-        angle= 0.0f;
-
-
+        direction= 0.0f;
 
         isFireing = false;
@@ -30,22 +28,7 @@
         lastTime = 0;
 
-        height = this->getGame()->center_->getFieldHeight();
-        width = this->getGame()->center_->getFieldWidth();
-
-        force.x =0;
-        force.y =0;
-
-        velocity.x = 0;
-        velocity.y = 0;
-
+        height = 600;
+        width = 1000;
     }
-
-    //Destructor
-    AsteroidsShip::~AsteroidsShip()
-    {
-        if (this->isInitialized())
-            this->cleanup();
-    }
-
 
 
@@ -53,51 +36,57 @@
     void AsteroidsShip::tick(float dt)
     {
+        orxout() << "ich ticke!"<< endl;
+        SUPER(AsteroidsShip, tick, dt);
+
         //Movement computation beachte Beschleunigung?
         Vector3 pos = getPosition();
+        Vector3 vel = getVelocity();
 
-        float speed = sqrt(velocity.x*velocity.x+ velocity.y*velocity.y);
+        float speed = sqrt(vel.x*vel.x+ vel.z*velo.z);
+
+
+        //Daempfung falls das spaceship zu schnell wird
         if(speed > maxspeed)
         {
-            velocity.x *= maxspeed/speed;
-            velocity.y *= mayspeed/speed;
+            vel.x *= maxspeed/speed;
+            vel.z *= mayspeed/speed;
         }
 
-        pos.x += velocity.x*dt;
-        pos.y += velocity.y*dt;
+        if(moveUpPressed_)
+        {
+            //Gas geben
+            vel.x += 1;
+            vel.z += 1;
+
+        }else if(moveDownPressed_){
+            //Bremsen
+            vel.x += 1;
+            vel.z += 1;
+        }else if(moveLeftPressed_){
+            //rotate left
+        }else if (moveRightPressed_){
+            //rotateright
+        }    
+
+        setVelocity(vel);
+        
+        pos.x += vel.x*dt;
+        pos.z += vel.z*dt;
 
 
-        //haelt ship innerhalb des Kamerafensters
-        if(x>width) x=0;
-        if(x<0) x=width;
-        if(y>height) y=0;
-        if(y<0) y=height);
+
+        //haelt ship innerhalb des Kamerafensters, kommt oben bzw seitlich wieder raus. Man spawnt in (0,0)
+        if(pos.x > width/2)   pos.x = -width/2;
+        if(pos.x < -width/2)  pos.x = width/2;
+        if(pos.z > height/2)  pos.z = -height/2;
+        if(pos.z < -height/2) pos.z = height/2;
 
 
         //Schiessen wenn geschossen wurde
         // shoot!
-/*
+
         if (isFireing)
             ControllableEntity::fire(0);
-        */
-
-        //Execute movement
-        if (this->hasLocalController())
-        {
-            force.x += 1;
-            force.y += 1;
-
-        }
-
-
-
-        //Camera ticken? Bleibt eigentlich am selben Ort...irgendwo initialisieren
-        Camera* camera = this->getCamera();
-        if (camera != nullptr)
-        {
-            camera->setPosition(Vector3(0,cameradistance, 0));
-            camera->setOrientation(Vector3::UNIT_Z, Degree(90));
-        }
-
-
+    
 
         // bring back on track!
@@ -107,11 +96,18 @@
         }
 
-        velocity.x *= damping;
-        velocity.y *= damping;
+        //Reibung?
+        vel.x *= damping;
+        vel.y *= damping;
+
 
         setPosition(pos);
-        setOrientation(Vector3::UNIT_Y, Degree(270));
+        setOrientation(Vector3::UNIT_Y, Degree(direction));
 
-        SUPER(AsteroidsShip, tick, dt);
+        // Reset key variables
+        moveUpPressed_ = false;
+        moveDownPressed_ = false;
+        moveLeftPressed_ = false;
+        moveDownPressed_ = false;
+
 
     }
@@ -119,16 +115,47 @@
     void AsteroidsShip::moveFrontBack(const Vector2& value)
     {
-        velocity.x += 1;
-    } 
+        if (value.x > 0)
+        {
+            moveUpPressed_ = true;
+            moveDownPressed_ = false
+            if(moveUpPressed_)
+            {
+                orxout() << "up" << endl;
+            }
+        }
+        else
+        {
+            moveUpPressed_ = false;
+            moveDownPressed_ = true;
+            if(moveDownPressed_)
+            {
+                orxout() << "down" << endl;
+            }
+        }
+    }
 
-    void AsteroidsShip::moveUpDown(const Vector2& value)
+    void AsteroidsShip::moveRightLeft(const Vector2& value)
     {
-        velocity.y +=1;
+        if (value.x > 0)
+        {
+            moveLeftPressed_ = false;
+            moveRightPressed_ = true;
+        }
+            if(moveRightPressed_)
+            {
+                orxout() << "right" << endl;
+            }
 
+        else
+        {
+            moveLeftPressed_ = true;
+            moveRightPressed_ = false;
+            if(moveLeftPressed_)
+            {
+                orxout() << "left" << endl;
+            }
+        }
     }
-    void AsteroidsShip::moveFrontLeftRight(const Vector2& value)
-    {
-
-    }
+    
 
     Asteroids* AsteroidsShip::getGame()
Index: code/branches/Asteroid_HS17/src/modules/asteroids/AsteroidsShip.h
===================================================================
--- code/branches/Asteroid_HS17/src/modules/asteroids/AsteroidsShip.h	(revision 11541)
+++ code/branches/Asteroid_HS17/src/modules/asteroids/AsteroidsShip.h	(revision 11555)
@@ -53,11 +53,10 @@
             virtual void tick(float dt) override;
 
-            // overwrite for 2d movement
+            //overwrite for 2d movement
             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
-            virtual void boost(bool bBoost) override;
+            //virtual void boost(bool bBoost) override;
 
 
@@ -69,12 +68,10 @@
 
             bool bEndGame;
-            bool bShowLevel;
             int lives;
-            float angle, radius;
-            float damping, posforeward;
+            float direction;
+            float damping;
             bool isFireing;
-            float dx, dy;
             const float maxspeed = 500;
-            const float cameradistance = 100;
+
 
             //Nachschauen wie gross das Spielfeld ist!
@@ -91,11 +88,8 @@
             WeakPtr<Asteroids> game;
             WeakPtr<WorldEntity> lastEntity;
-            Camera* camera;
             float lastTimeFront, lastTimeLeft, lastTime;
-            struct Vector
-            {
-                float x;
-                float y;
-            }force, velocity
+
+            //Controller
+            bool moveUpPressed_, moveDownPressed_, moveRightPressed_, moveLeftPressed_;
             
     };
Index: code/branches/Asteroid_HS17/src/modules/asteroids/AsteroidsStone.cc
===================================================================
--- code/branches/Asteroid_HS17/src/modules/asteroids/AsteroidsStone.cc	(revision 11541)
+++ code/branches/Asteroid_HS17/src/modules/asteroids/AsteroidsStone.cc	(revision 11555)
@@ -28,6 +28,6 @@
 
 /**
-    @file InvaderEnemy.h
-    @brief Declaration of the InvaderEnemy class.
+    @file AsteroidsEnemy.h
+    @brief Declaration of the AsteroidsEnemy class.
 */
 
@@ -36,7 +36,9 @@
 #include "Asteroids.h"
 #include "AsteroidsShip.h"
+#include <cstdlib>
 #include <cmath>
 #include "util/Math.h"
 
+const float delta = 3;
 
 namespace orxonox
@@ -48,12 +50,26 @@
         RegisterObject(AsteroidsStone);
 
+        direction = 0;
+        //Spielfeld x als Horizontale und z als Vertikale
+        fieldWidth_ = this->getGame()->center_->getFieldWidth;
+        fieldHeigth_ = this->getGame()->center_->getFieldHeight;
+
+
+        //Random size 1, 2, 3 ->muss noch realisiert werden. Templates erstellen
+        this.size = 1;
         maxspeed = 50.0f;
         //Random Spawn? pos= random? -> spawn durch timer in der Asteroids Klasse
-        this->setPosition(rnd(0, fieldWidth_), rnd(0, fieldHeigth_), 0);
+        this->setPosition(rnd(fieldWidth_), 0, rnd(fieldHeigth));
 
-		//random Geschwindigkeit und Richtung
-		velocity.x = rnd(0, maxspeed);
-		velocity.y = rnd(0, maxspeed);
-        this->context = context;
+        //random Geschwindigkeit und Richtung
+        velocity.x = rnd(maxspeed);
+        velocity.y = rnd(maxspeed);
+    }
+
+    inline bool AsteroidsStone::collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint)
+    {
+        if(orxonox_cast<AsteroidsShip*>(otherObject))
+            removeHealth(2000);
+        return false;
     }
 
@@ -64,16 +80,25 @@
         }else if(this->size == 2){
             Pawn::death();
-
             //Wie mache ich das ? Eigentlich in der game Klasse? sonst zeigt der Pointer auf einen falschen Bereich
-
             for(int i = 0; i<2; i++)
             {
                 AsteroidsStone* newStone;
-                newStone = new AsteroidsStone(this->context);
+                newStone = new AsteroidsStone(this->getGame()->center_->getContext());
                 newStone->addTemplate("asteroidsstone");
-                newStone->setAsteroidsPlayer(player);
+                newStone->setAsteroidsPlayer(this->getGame()->player);
             }
 
         }
+    }
+    
+
+    Asteroids* AsteroidsStone::getGame()
+    {
+        if (game == nullptr)
+        {
+            for (Asteroids* Asteroids : ObjectList<Asteroids>())
+                game = asteroids;
+        }
+        return game;
     }
 
@@ -82,12 +107,25 @@
     void AsteroidsStone::tick(float dt)
     {
-    	Vector3 pos = this->getPosition();
-    	pos.x += velocity.x*dt;
-    	pos.z += velocity.y*dt;
+        Vector3 pos = getPosition();
 
+
+
+
+        //bounce on the borders
+        if(pos.x-delta <= 0 || pos.x+delta >= fieldWidth_)
+            direction = -direction;
+
+
+
+        //zurück bringen
         if(pos.y != 0){
             pos.y=0;
         }
+
+        //spin
+
+        setOrientation()
         setPosition(pos);
+
         SUPER(AsteroidsStone, tick, dt);
     }
@@ -95,5 +133,5 @@
     inline bool AsteroidsStone::collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint)
     {
-        if(orxonox_cast<InvaderShip*>(otherObject))
+        if(orxonox_cast<AsteroidsShip*>(otherObject))
             removeHealth(2000);
         return false;
Index: code/branches/Asteroid_HS17/src/modules/asteroids/AsteroidsStone.h
===================================================================
--- code/branches/Asteroid_HS17/src/modules/asteroids/AsteroidsStone.h	(revision 11541)
+++ code/branches/Asteroid_HS17/src/modules/asteroids/AsteroidsStone.h	(revision 11555)
@@ -50,9 +50,14 @@
             //Es gibt 3 Groessen von Meteroiden gross, mittel, klein, gross ->2 mittleren, mittel -> 2 kleinen, kleine-> verschwinden
             int size;
-            int level;
+
             virtual void setAsteroidsPlayer(AsteroidsShip* player){this->player = player;}
+            virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) override;
+
 
 
         protected:
+
+            Asteroids* getGame();
+            WeakPtr<Asteroids> game;
 
             virtual void death() override;
@@ -60,11 +65,10 @@
 
             //herausfinden->ueber Kamera Einstellung wie bei Pong?
-            float fieldWidth_=500;
-            float fieldHeight_=700;
+            float fieldWidth_;
+            float fieldHeight_;
             Vector2 velocity;
             float maxspeed;
+            float direction;
 
-        private:
-            Context* context;
     };
 }
