Index: /code/branches/FlappyOrx_HS17/src/modules/flappyorx/FlappyOrx.cc
===================================================================
--- /code/branches/FlappyOrx_HS17/src/modules/flappyorx/FlappyOrx.cc	(revision 11597)
+++ /code/branches/FlappyOrx_HS17/src/modules/flappyorx/FlappyOrx.cc	(revision 11598)
@@ -66,4 +66,6 @@
         spawnDistance=200;                  //distance between tubes
         tubeOffsetX=500;                    //tube offset (so that we can't see them spawn)
+
+        circlesUsed=0;
         setHUDTemplate("FlappyOrxHUD");
     }
@@ -127,5 +129,5 @@
         int noadd = 0;  //how many times we failed to add a new asteroid
 
-        ClearAsteroids();   //Delete Asteroids
+        clearCircles();   //Delete Circles (we use circles to make sure we don't spawn two asteroids on top of eachother)
         Circle newAsteroid = Circle();
         newAsteroid.x=x;
@@ -135,5 +137,5 @@
 
         //Fill up triangle with asteroids
-        while(r>0){
+        while(noadd<5&&circlesUsed<nCircles){
             if(slope>0)
                 newAsteroid.y=float(rand())/RAND_MAX*(150+y)-150;   //create asteroid on bottom
@@ -148,9 +150,5 @@
                 noadd++;
             else if(i==2)
-                r=0;
-            if(noadd>=5){
-                noadd=0;
-                r-=5;
-            }
+                noadd=5;
         }
     }
@@ -179,4 +177,42 @@
         //add to Queue (so that we can delete it again)
         asteroids.push(newAsteroid);
+    }
+
+    //Deletes Asteroids array which stores all the circles used to make sure no asteroids collide when spawning
+    void FlappyOrx::clearCircles(){
+        circlesUsed=0;
+        for(int i = 0; i<this->nCircles; i++){
+            circles[i].r=0;
+        }
+    }
+
+    //checks if two circles collide
+    bool FlappyOrx::circleCollision(Circle &c1, Circle &c2){
+        if(c1.r<=0 || c2.r<=0)
+            return false;
+        int x = c1.x - c2.x;
+        int y = c1.y - c2.y;
+        int r = c1.r + c2.r;
+
+        return x*x+y*y<r*r*1.5;
+    }
+
+    //Adds a circle if its not colliding
+    int FlappyOrx::addIfPossible(Circle c){
+        int i;
+        for(i=0; i<this->nCircles && this->circles[i].r!=0 && c.r>0;i++){
+            while(circleCollision(c,this->circles[i])){
+                c.r-=5; //when it collides, try to make it smaller
+            }
+        }
+        if(c.r<=0){
+            return 0;
+        }
+        circlesUsed++;
+        this->circles[i].x=c.x;
+        this->circles[i].y=c.y;
+        this->circles[i].r=c.r;
+        createAsteroid(c);
+        return 1;
     }
 
Index: /code/branches/FlappyOrx_HS17/src/modules/flappyorx/FlappyOrx.h
===================================================================
--- /code/branches/FlappyOrx_HS17/src/modules/flappyorx/FlappyOrx.h	(revision 11597)
+++ /code/branches/FlappyOrx_HS17/src/modules/flappyorx/FlappyOrx.h	(revision 11598)
@@ -21,7 +21,6 @@
  *
  *   Author:
- *      Florian Zinggeler
- *   Co-authors:
- *      ...
+ *      Leo Mehr Holz
+ *      Pascal Schärli
  *
  */
@@ -39,5 +38,4 @@
 
 #include "gametypes/Deathmatch.h"
-#include "tools/Timer.h"
 #include <vector>
 
@@ -77,15 +75,8 @@
             void setCenterpoint(FlappyOrxCenterPoint* center);
 
-            int getLives(){return this->lives;}
-            int getLevel(){return this->level;}
             int getPoints(){return this->point;}
-            int getMultiplier(){return this->multiplier;}
-
-            void costLife();
+            
             void levelUp();
-            void addPoints(int numPoints);
-            // checks if multiplier should be reset.
-            void comboControll();
-
+            
             bool isDead();
             void setDead(bool value);
@@ -93,8 +84,5 @@
             FlappyOrxShip* getPlayer();
             
-            int lives;
-            int multiplier;
             bool bEndGame;
-            bool bShowLevel;
             bool bIsDead;
             bool firstGame;
@@ -106,51 +94,16 @@
             
         private:
-            void toggleShowLevel(){bShowLevel = !bShowLevel;}
-            
-            const static int nAst = 7;
-            Circle Asteroids[nAst];
+             
+            const static int nCircles = 6;
+            int circlesUsed;
+            Circle circles[nCircles];
 
-            void ClearAsteroids(){
-                for(int i = 0; i<this->nAst; i++){
-                    Asteroids[i].r=0;
-                }
-            }
-
-            
-            bool Collision(Circle &c1, Circle &c2){
-                if(c1.r==0 || c2.r==0)
-                    return false;
-                int x = c1.x - c2.x;
-                int y = c1.y - c2.y;
-                int r = c1.r + c2.r;
-
-                return x*x+y*y<r*r*1.5;
-            }
-
-            int addIfPossible(Circle c){
-                int i;
-                for(i=0; i<this->nAst && this->Asteroids[i].r!=0;i++){
-                    if(Collision(c,this->Asteroids[i])){
-                        return 0;
-                    }
-                }
-                if(i==nAst)
-                    return 2;
-                this->Asteroids[i].x=c.x;
-                this->Asteroids[i].y=c.y;
-                this->Asteroids[i].r=c.r;
-                createAsteroid(c);
-                return 1;
-            }
-            
-            
+            void clearCircles();
+            bool circleCollision(Circle &c1, Circle &c2);
+            int addIfPossible(Circle c);
 
             WeakPtr<FlappyOrxCenterPoint> center_;
             WeakPtr<FlappyOrxShip> player;
 
-            Timer enemySpawnTimer;
-            Timer comboTimer;
-            Timer showLevelTimer;
-            //Context* context;
             int level;
             int point;
