ELEC2645 (2017/18) / Mbed 2 deprecated fy15raf

Dependencies:   mbed

Revision:
11:cb48d596aa3e
Parent:
8:13cef7cb872e
Child:
12:4d7f1349d796
--- a/Asteroids/Asteroid.cpp	Thu May 03 12:07:54 2018 +0000
+++ b/Asteroids/Asteroid.cpp	Thu May 03 22:34:03 2018 +0000
@@ -17,24 +17,25 @@
 
    // srand(time(NULL));
     _y1 = rand()%(HEIGHT); // random initial position on y-axis.
-
+//_y1 =22;
     _velocity.x = speed;
 }
 
 void Asteroid::draw(N5110 &lcd)
 {
 
-    int sprite[6][10] =   {
+    int sprite[6][11] =   {
 
-        { 0,0,0,0,1,1,0,1,0,0, },
-        { 0,0,1,1,0,0,1,0,0,0, },
-        { 0,1,1,1,1,0,1,1,1,0, },
-        { 0,1,1,1,1,0,1,1,1,1, },
-        { 0,0,1,1,0,0,1,0,0,0, },
-        { 0,0,0,0,1,1,0,1,0,0, },
+        
+        { 0,0,1,1,0,1,0,0,1,1,0, },
+        { 0,1,1,1,1,1,1,0,0,0,0, },
+        { 1,1,0,1,1,1,0,1,0,0,0, },
+        { 1,1,1,1,1,1,1,1,0,1,1, },
+        { 0,1,1,1,0,1,1,0,0,0,0, },
+        { 0,0,0,1,1,1,0,0,1,1,0, },
          
     };
-    lcd.drawSprite(_x,_y1,6,10,(int *)sprite);
+    lcd.drawSprite(_x,_y1,6,11,(int *)sprite);
 }
 
 void Asteroid::update()
@@ -44,6 +45,7 @@
     } else {
         _x = WIDTH - _size; //start from the begining again
         _y1= rand()%(HEIGHT);
+        //_y1 =22;
     }
 }