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: barrier.cpp
- Revision:
- 26:3270c6edd7d9
- Parent:
- 23:56f6a12aaebd
- Child:
- 28:a2dac56af32f
--- a/barrier.cpp Wed Apr 28 01:17:30 2021 +0000 +++ b/barrier.cpp Wed Apr 28 03:12:39 2021 +0000 @@ -63,6 +63,7 @@ void erase_barrier(int blk_x, int blk_y, int barrier_width, int barrier_height) { uLCD.filled_rectangle(blk_x,blk_y,blk_x+barrier_width,blk_y+barrier_height,BACKGROUND_COLOR); + } void barrier_init(barrier_t * g, int blk_x, int blk_y, int color) @@ -86,6 +87,7 @@ void barrier_erase(barrier_t *g) { erase_barrier(g->barrier_blk_x, g->barrier_blk_y, g->barrier_width, g->barrier_height); + memset(g->barrierPixels, 0, sizeof(bool) * 20 * 20); } void check_barrier(barrier_t * g, missile_t * h)