Space Racers! is a Space Invaders clone for the MBED. The goal is to avoid the oncoming alien onslaught by shooting them with your missiles. The aliens traverse the screen getting lower and lower until they either reach the bottom of the screen or shoot your spaceship player 3 times. To win the game, the user has to shoot all 9 of the enemy aliens. The controls can be handled either with the navigation switch or the Adafruit Bluetooth Connect app Control Pad on your mobile device. Left and Right arrows are used to move the player, the up arrow is used to shoot at the aliens.

Dependencies:   4DGL-uLCD-SE PinDetect mbed wave_player

Revision:
0:aeb7a12718ed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Alien.h	Wed May 02 18:49:04 2018 +0000
@@ -0,0 +1,45 @@
+#include "uLCD_4DGL.h"
+#include "mbed.h"
+extern uLCD_4DGL uLCD;
+
+class Alien 
+{
+    public: 
+    int oldx, oldy, x, y; 
+    bool alive;
+    Alien() {}
+    Alien(int xx, int yy) { //starting position
+        oldx = xx;
+        oldy = yy;
+        x = xx;
+        y = yy;
+        alive = true;
+        }
+        
+    void draw() {
+        
+//        if (x != oldx) {
+//            uLCD.filled_circle(x,y,4,BLACK);
+//            uLCD.filled_rectangle(x-5, y+6,x-3, y+4,BLACK);
+//            uLCD.filled_rectangle(x+3,y+6,x+5,y+4,BLACK);
+//            uLCD.filled_circle(x-2,y-1,1.5,BLACK);
+//            uLCD.filled_circle(x+2,y-1,1.5,BLACK);
+//            }
+//            uLCD.triangle( x-3, y+3 ,x,y, x+3, y+3, GREEN); 
+            uLCD.filled_circle(x,y,4,GREEN);
+            uLCD.filled_rectangle(x-5, y+6,x-3, y+4,GREEN);
+            uLCD.filled_rectangle(x+3,y+6,x+5,y+4,GREEN);
+            uLCD.filled_circle(x-2,y-1,1.5,RED);
+            uLCD.filled_circle(x+2,y-1,1.5,RED);
+        }
+        
+        void erase() {
+//            uLCD.triangle( x-3, y+3 ,x,y, x+3, y+3, GREEN); 
+            uLCD.filled_circle(x,y,4,BLACK);
+            uLCD.filled_rectangle(x-5, y+6,x-3, y+4,BLACK);
+            uLCD.filled_rectangle(x+3,y+6,x+5,y+4,BLACK);
+            uLCD.filled_circle(x-2,y-1,1.5,BLACK);
+            uLCD.filled_circle(x+2,y-1,1.5,BLACK);
+            
+        }
+    };