Elements used in the Balls and Things games for the RETRO.

Dependents:   RETRO_BallsAndPaddle RETRO_BallAndHoles

Revision:
7:4fa3edaa1201
Parent:
5:065f19e08dcb
--- a/Ball.cpp	Sat Feb 28 19:40:48 2015 +0000
+++ b/Ball.cpp	Mon Mar 02 09:04:13 2015 +0000
@@ -20,9 +20,6 @@
     r=r*2/3;
     g=g*2/3;
     b=b*2/3;
-//    r=r/2;
-//    g=g/2;
-//    b=b/2;
 
     return(Color565::fromRGB((uint16_t)r,(uint16_t)g,(uint16_t)b));
 }
@@ -107,7 +104,6 @@
     this->unmove(); // undo move to pre-bouncing position to avoid drawing on colliding position
 
     this->vSpeed.multiply(vBounce);
-    //this->vSpeed.bounce(vBounce);
 
     // check speed w/max
     if(this->vSpeed.y>5.0) this->vSpeed.y=5;
@@ -129,15 +125,8 @@
     if(this->vSpeed.y<-5.0) this->vSpeed.y=-5;
     if(this->vSpeed.x<-5.0) this->vSpeed.x=-5;
 
-    if(abs(vSpeed.x)>abs(vSpeed.y))
-        vSpeed.x=vSpeed.x/abs(vSpeed.x) * abs(vSpeed.y);
-
-/*    
-    if(this->vSpeed.y>0 && this->vSpeed.y<1.0) this->vSpeed.y=1;
-    if(this->vSpeed.x>0 && this->vSpeed.x<1.0) this->vSpeed.x=1;
-    if(this->vSpeed.y<0 && this->vSpeed.y>-1.0) this->vSpeed.y=-1;
-    if(this->vSpeed.x<0 && this->vSpeed.x>-1.0) this->vSpeed.x=-1;
-*/
+//    if(abs(vSpeed.x)>abs(vSpeed.y))
+//        vSpeed.x=vSpeed.x/abs(vSpeed.x) * abs(vSpeed.y);
 }