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
test
Diff: globals.cpp
- Revision:
- 28:a2dac56af32f
- Parent:
- 23:56f6a12aaebd
diff -r 3270c6edd7d9 -r a2dac56af32f globals.cpp --- a/globals.cpp Wed Apr 28 03:12:39 2021 +0000 +++ b/globals.cpp Wed Apr 28 15:21:44 2021 +0000 @@ -1,10 +1,11 @@ #include "globals.h" #include "mbed.h" + // Modified from the RPG Game from ECE 2035. Draw more complex player object (with changing color). - void draw_img(int u, int v, int width, int height, const char* img) { int colors[width*height]; + // create the array used by uLCD.BLIT to create more complex sprites. for (int i = 0; i < width*height; i++) { if (img[i] == 'G') colors[i] = GREEN;