Index: code/branches/FlappyOrx_HS17/src/modules/flappyorx/FlappyOrx.cc
===================================================================
--- code/branches/FlappyOrx_HS17/src/modules/flappyorx/FlappyOrx.cc	(revision 11533)
+++ code/branches/FlappyOrx_HS17/src/modules/flappyorx/FlappyOrx.cc	(revision 11537)
@@ -74,4 +74,5 @@
 
     void FlappyOrx::updatePlayerPos(int x){
+
         if(this->tubes.size()==0||x-this->tubes.back()-tubeOffsetX>spawnDistance){
             spawnTube();
@@ -82,4 +83,9 @@
             levelUp();
             point++;
+        }
+        while((this->asteroids.front())->getPosition().x<x-300){
+            MovableEntity* deleteMe = asteroids.front();
+            asteroids.pop();
+            deleteMe->destroy();
         }
     }
@@ -144,7 +150,14 @@
     }
 
+    void deleteAsteroid(MovableEntity* asteroid){
+        //center_->getContext().getObjectList().removeElement(asteroid);
+    }
+
     void FlappyOrx::createAsteroid(Circle &c){
         orxout() << "created Asteroid at x="<<c.x<<" y="<<c.y << std::endl;
+
         MovableEntity* newAsteroid = new MovableEntity(this->center_->getContext());
+
+
         if(c.r<=5)
             newAsteroid->addTemplate(Asteroid5[rand()%6]);
@@ -160,4 +173,7 @@
         newAsteroid->setOrientation(Vector3::UNIT_Y, Degree(rand()%360));
 
+        asteroids.push(newAsteroid);
+
+
     }
 
@@ -169,9 +185,5 @@
     void FlappyOrx::costLife()
     {
-        lives--;
-        multiplier = 1;
-        // end the game in 30 seconds.
-        if (lives <= 0)
-            enemySpawnTimer.setTimer(30.0f, false, createExecutor(createFunctor(&FlappyOrx::end, this)));
+        
     };
 
@@ -206,4 +218,24 @@
             point += numPoints * multiplier;
             b_combo = true;
+        }
+    }
+
+    void FlappyOrx::death(){
+        if (Highscore::exists()){
+                    int score = this->getPoints();
+                    if(score > Highscore::getInstance().getHighestScoreOfGame("Orxonox Arcade")) 
+                        Highscore::getInstance().storeHighscore("Orxonox Arcade",score);
+
+        }
+        point = 0;
+        while (!tubes.empty())
+        {
+            tubes.pop();
+        }
+        while (!asteroids.empty())
+        {
+            MovableEntity* deleteMe = asteroids.front();
+            asteroids.pop();
+            deleteMe->destroy();
         }
     }
Index: code/branches/FlappyOrx_HS17/src/modules/flappyorx/FlappyOrx.h
===================================================================
--- code/branches/FlappyOrx_HS17/src/modules/flappyorx/FlappyOrx.h	(revision 11533)
+++ code/branches/FlappyOrx_HS17/src/modules/flappyorx/FlappyOrx.h	(revision 11537)
@@ -68,4 +68,5 @@
             virtual void start() override;
             virtual void end() override;
+            virtual void death();
             virtual void addBots(unsigned int amount) override{} //<! overwrite function in order to bypass the addbots command
 
@@ -92,4 +93,5 @@
             bool bShowLevel;
             std::queue<int> tubes;
+            std::queue<MovableEntity*> asteroids;
             int spawnDistance;
             int tubeOffsetX;
@@ -146,8 +148,10 @@
             int point;
             bool b_combo;
-            std::string Asteroid5[6] = {"Asteroid3_1","Asteroid3_2","Asteroid3_3","Asteroid3_4","Asteroid3_5","Asteroid3_6"};
-            std::string Asteroid10[6] = {"Asteroid6_1","Asteroid6_2","Asteroid6_3","Asteroid6_4","Asteroid6_5","Asteroid6_6"};
-            std::string Asteroid15[6] = {"Asteroid9_1","Asteroid9_2","Asteroid9_3","Asteroid9_4","Asteroid9_5","Asteroid9_6"};
-            std::string Asteroid20[6] = {"Asteroid12_1","Asteroid12_2","Asteroid12_3","Asteroid12_4","Asteroid12_5","Asteroid12_6"};
+
+            const std::string Asteroid5[6] = {"Asteroid3_1","Asteroid3_2","Asteroid3_3","Asteroid3_4","Asteroid3_5","Asteroid3_6"};
+            const std::string Asteroid10[6] = {"Asteroid6_1","Asteroid6_2","Asteroid6_3","Asteroid6_4","Asteroid6_5","Asteroid6_6"};
+            const std::string Asteroid15[6] = {"Asteroid9_1","Asteroid9_2","Asteroid9_3","Asteroid9_4","Asteroid9_5","Asteroid9_6"};
+            const std::string Asteroid20[6] = {"Asteroid12_1","Asteroid12_2","Asteroid12_3","Asteroid12_4","Asteroid12_5","Asteroid12_6"};
+            
 
 
Index: code/branches/FlappyOrx_HS17/src/modules/flappyorx/FlappyOrxAsteroid.cc
===================================================================
--- code/branches/FlappyOrx_HS17/src/modules/flappyorx/FlappyOrxAsteroid.cc	(revision 11533)
+++ code/branches/FlappyOrx_HS17/src/modules/flappyorx/FlappyOrxAsteroid.cc	(revision 11537)
@@ -1,89 +1,0 @@
-/*
- *   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 FlappyOrxAsteroid.h
-    @brief Declaration of the FlappyOrxAsteroid class.
-*/
-
-#include "FlappyOrxAsteroid.h"
-
-#include "core/CoreIncludes.h"
-#include "FlappyOrx.h"
-#include "FlappyOrxShip.h"
-
-namespace orxonox
-{
-    RegisterClass(FlappyOrxAsteroid);
-
-    FlappyOrxAsteroid::FlappyOrxAsteroid(Context* context) : Pawn(context)
-    {
-        RegisterObject(FlappyOrxAsteroid);
-        enableCollisionCallback();
-        lifetime = 0;
-    }
-
-    void FlappyOrxAsteroid::tick(float dt)
-    {
-        lifetime += dt;
-        // die after 5 seconds.
-        if (lifetime > 5000)
-            removeHealth(2000);
-
-        if (player != nullptr)
-        {
-            float newZ = 2/(pow(std::abs(getPosition().x - player->getPosition().x) * 0.01f, 2) + 1) * (player->getPosition().z - getPosition().z);
-            setVelocity(Vector3(1000.f - level * 100 , 0, newZ));
-        }
-        SUPER(FlappyOrxAsteroid, tick, dt);
-    }
-
-    inline bool FlappyOrxAsteroid::collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint)
-    {
-        if(orxonox_cast<FlappyOrxShip*>(otherObject))
-            removeHealth(2000);
-        return false;
-    }
-
-    FlappyOrx* FlappyOrxAsteroid::getGame()
-    {
-        if (game == nullptr)
-        {
-            for (FlappyOrx* flappyOrx : ObjectList<FlappyOrx>())
-                game = flappyOrx;
-        }
-        return game;
-    }
-
-    void FlappyOrxAsteroid::damage(float damage, float healthdamage, float shielddamage, Pawn* originator, const btCollisionShape* cs)
-    {
-        Pawn::damage(damage, healthdamage, shielddamage, originator, cs);
-        if (getGame() && orxonox_cast<FlappyOrxShip*>(originator) != nullptr && getHealth() <= 0)
-            getGame()->addPoints(42);
-    }
-}
Index: code/branches/FlappyOrx_HS17/src/modules/flappyorx/FlappyOrxAsteroid.h
===================================================================
--- code/branches/FlappyOrx_HS17/src/modules/flappyorx/FlappyOrxAsteroid.h	(revision 11533)
+++ code/branches/FlappyOrx_HS17/src/modules/flappyorx/FlappyOrxAsteroid.h	(revision 11537)
@@ -1,72 +1,0 @@
-/*
- *   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 FlappyOrxAsteroid.h
-    @brief Declaration of the FlappyOrxAsteroid class.
-*/
-
-#ifndef _FlappyOrxAsteroid_H__
-#define _FlappyOrxAsteroid_H__
-
-#include "flappyorx/FlappyOrxPrereqs.h"
-
-#include "worldentities/pawns/Pawn.h"
-
-namespace orxonox
-{
-    class _FlappyOrxExport FlappyOrxAsteroid : public Pawn
-    {
-        public:
-            FlappyOrxAsteroid(Context* context);
-
-            virtual void tick(float dt) override;
-            virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) override;
-            virtual void damage(float damage, float healthdamage, float shielddamage, Pawn* originator, const btCollisionShape* cs) override;
-            virtual void setFlappyOrxPlayer(FlappyOrxShip* player){this->player = player;}
-
-            int level;
-        protected:
-            FlappyOrx* getGame();
-            WeakPtr<FlappyOrx> game;
-            WeakPtr<FlappyOrxShip> player;
-            Camera* camera;
-            bool isFireing;
-            float speed, damping;
-            float lastTimeFront, lastTimeLeft;
-            float lifetime;
-            struct Velocity
-            {
-                float x;
-                float y;
-            } velocity, desiredVelocity;
-
-    };
-}
-
-#endif /* _FlappyOrxAsteroid_H__ */
Index: code/branches/FlappyOrx_HS17/src/modules/flappyorx/FlappyOrxShip.cc
===================================================================
--- code/branches/FlappyOrx_HS17/src/modules/flappyorx/FlappyOrxShip.cc	(revision 11533)
+++ code/branches/FlappyOrx_HS17/src/modules/flappyorx/FlappyOrxShip.cc	(revision 11537)
@@ -70,5 +70,6 @@
             if(getHealth()<0){
                  getGame()->costLife();
-                 getGame()->end();
+                 getGame()->death();
+                 death();
             }
             Vector3 pos = getPosition();
@@ -151,5 +152,7 @@
     void FlappyOrxShip::death()
     {
-
+        Vector3 pos = getPosition();
+        pos.x = 0;
+        setPosition(pos);
     }
 }
