- Timestamp:
- Feb 17, 2018, 11:50:25 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/Presentation_HS17_merge/src/modules/flappyorx/FlappyOrx.cc
r11759 r11760 142 142 143 143 //Fill up triangle with asteroids 144 while(noadd<5&&circlesUsed< nCircles){144 while(noadd<5&&circlesUsed<NUM_CIRCLES){ 145 145 if(slope>0) 146 146 newAsteroid.y=rnd(150+y)-150; //create asteroid on bottom … … 187 187 void FlappyOrx::clearCircles(){ 188 188 circlesUsed=0; 189 for(int i = 0; i< this->nCircles; i++){189 for(int i = 0; i<NUM_CIRCLES; i++){ 190 190 circles[i].r=0; 191 191 } … … 206 206 int FlappyOrx::addIfPossible(Circle c){ 207 207 int i; 208 for(i=0; i< this->nCircles&& this->circles[i].r!=0 && c.r>0;i++){208 for(i=0; i<NUM_CIRCLES && this->circles[i].r!=0 && c.r>0;i++){ 209 209 while(circleCollision(c,this->circles[i])){ 210 210 c.r-=5; //when it collides, try to make it smaller
Note: See TracChangeset
for help on using the changeset viewer.