Meteor defense project

Dependencies:   N5110 mbed

Revision:
25:edd6a95607b1
Parent:
24:d6187d39f09b
Child:
26:140515d80457
diff -r d6187d39f09b -r edd6a95607b1 GameEngine/GameEngine.cpp
--- a/GameEngine/GameEngine.cpp	Thu Apr 13 17:05:45 2017 +0000
+++ b/GameEngine/GameEngine.cpp	Thu Apr 13 22:21:02 2017 +0000
@@ -25,7 +25,12 @@
 }
 void GameEngine::drawSpawn(N5110 &lcd){
     //spawning every 2 second, moving spawn at every 1 seconds when fps = 15 & drawit=30. 
-    //It changes depending on the game FPS.
+    //It changes depending on the game FPS. 
+    for (int x = 0; x < Cols; x++) {
+        for (int y = 0; y < Rows; y++) {
+            spa.deleteChar(x, y, Array2, charArray); //clean up on the array if the spawn dies after taking damage.
+        }
+    }    
     if (drawit == 0) { //DONT FORGET TO CHANGE THIS TO TICKER. MORE EFFICIENT.
         drawit = 30;
         spa.randomizeSpawn(Array, charArray);
@@ -64,7 +69,6 @@
 }
 void GameEngine::bombAndShield(Gamepad &pad, N5110 &lcd) { 
     weap.bombCooldown(Array2, pad, lcd);
-    //spa.deleteChar(x, y, Arr2, cArr2);
     if (pad.check_event(Gamepad::X_PRESSED)) {
         //to prevent from detonating the bomb at instant when button X is accidentally pressed 
     }