Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: 4DGL-uLCD-SE SDFileSystem mbed wave_player
Fork of missile_command by
Diff: missile/missile.cpp
- Revision:
- 2:d39a6a36e0c0
- Parent:
- 0:532cb55d6136
diff -r 3da29f1d84b4 -r d39a6a36e0c0 missile/missile.cpp
--- a/missile/missile.cpp Wed Oct 29 02:58:53 2014 +0000
+++ b/missile/missile.cpp Mon Nov 17 13:15:34 2014 +0000
@@ -22,7 +22,7 @@
#include "missile_private.h"
-MISSILE missile_record[MAX_NUM_MISSILE];
+
int missile_tick=0;
int missile_interval = 10;
int missile_speed = 4;
@@ -121,6 +121,13 @@
missile_record[i].status = MISSILE_DEACTIVE;
//resets the missile's internal tick
missile_record[i].tick = 0;
+ }
+
+ if (missile_record[i].y > 128) {
+ //when the missile hit the ground
+ missile_draw(missile_record[i], BACKGROUND_COLOR);
+ missile_record[i].tick = 0;
+ missile_record[i].status = MISSILE_DEACTIVE;
}
}
