Updated Space Invaders on the mbed. Improved upon Michael Son's "Mbed Space Invaders" at https://os.mbed.com/users/michaeljson/notebook/mbed-space-invaders/.

Dependencies:   mbed wave_player mbed-rtos 4DGL-uLCD-SE SparkfunAnalogJoystick SDFileSystem LSM9DS1_Library_cal_updated

Fork of Two-PlayerSpaceInvaders by William Minix

test

Revision:
20:ede4fa57d082
Parent:
0:3817adfaeb06
Child:
21:a6b4c5598083
--- a/player.cpp	Fri Apr 23 15:09:22 2021 +0000
+++ b/player.cpp	Sun Apr 25 03:13:50 2021 +0000
@@ -1,9 +1,36 @@
 #include "player.h"
 #include "missile.h"
 
+#define GREEN 0x00FF00
+#define BLUE 0x0000FF
+#define PINK 0xFFC0CB
+#define YELLOW 0xFFFF00
+#define BROWN  0xD2691E
+#define DIRT   BROWN
+void draw_img(int u, int v, const char* img)
+{
+    int colors[11*11];
+    for (int i = 0; i < 11*11; i++)
+    {
+        if (img[i] == 'R') colors[i] = RED;
+        else if (img[i] == 'Y') colors[i] = YELLOW;
+        else if (img[i] == 'G') colors[i] = GREEN;
+        else if (img[i] == 'D') colors[i] = DIRT;
+        else if (img[i] == '5') colors[i] = LGREY;
+        else if (img[i] == '3') colors[i] = DGREY;
+        else if (img[i] == 'W') colors[i] = WHITE;
+        else if (img[i] == 'U') colors[i] = BLUE;
+        else colors[i] = BLACK;
+    }
+    uLCD.BLIT(u, v, 11, 11, colors);
+    wait_us(250); // Recovery time!
+}
+
 void draw_player_object(int blk_x, int blk_y, int player_color, int p_width, int p_height)
 {
-    uLCD.filled_rectangle(blk_x,blk_y,blk_x+p_width,blk_y+p_height,player_color);
+    //uLCD.filled_rectangle(blk_x,blk_y,blk_x+p_width,blk_y+p_height,player_color);
+    const int* colors = [
+    uLCD.BLIT(blk_x, blk_y, e_width, e_height, 
 }
 
 void erase_player(int blk_x, int blk_y, int p_width, int p_height)