Sizhe Lin / Mbed 2 deprecated missile_command_Sizhe_Lin

Dependencies:   4DGL-uLCD-SE SDFileSystem mbed wave_player

Fork of missile_command by ECE 2035 TA

Revision:
2:d39a6a36e0c0
Parent:
0:532cb55d6136
--- 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;
         }
         
     }