Meteor defense project

Dependencies:   N5110 mbed

Revision:
30:2e2d48cbfec3
Parent:
25:edd6a95607b1
Child:
31:1c0e47931e84
--- a/Spawn/Spawn.h	Tue Apr 18 11:21:35 2017 +0000
+++ b/Spawn/Spawn.h	Tue Apr 18 21:50:14 2017 +0000
@@ -10,28 +10,50 @@
 #define Rows 48
 #define Cols 84
 
+struct Stats {
+    int spawnRate;
+    int health;
+};
 class Spawn
 {
 public:
     Spawn();
     ~Spawn();
-    //spawnHealth
-    void init();
+    
+    void init(int w);
+    
     void randomizeSpawn(int Arr[][Rows], char cArr[][Rows]);
+    //http://stackoverflow.com/questions/10289197/how-to-empty-a-2d-char-array-in-c
+    void moveSpawnABC(int Arr[][Rows], int Arr2[][Rows], char cArr[][Rows], char cArr2[][Rows]);
+    void moveSpawnB(int Arr[][Rows], int Arr2[][Rows], char cArr[][Rows], char cArr2[][Rows]);
+    void moveSpawnDE(int Arr[][Rows], int Arr2[][Rows], char cArr[][Rows], char cArr2[][Rows]);
+    
+    //a tool to clean up the array 
+    void updateSpawn(int Arr[][Rows], int Arr2[][Rows], char cArr[][Rows], char cArr2[][Rows], N5110 &lcd);
+    void deleteChar(int x, int y, int Arr[][Rows], char cArr[][Rows]); 
+    
+    //messing with the struct
+    Stats statsA(int w);
+    Stats statsB(int w);
+    Stats statsC(int w);
+    Stats statsDE(int w);
+    
+private:
+    //this makes the spawnA stop spawning for a row and spawn for another.
+    int stopSpawnA;
     void spawnA(int Arr[][Rows],char cArr[][Rows]); //normal spawn
     void spawnB(int x, int Arr[][Rows],char cArr[][Rows]); //fast moving spawn
     void spawnC(int Arr[][Rows],char cArr[][Rows]); //tanky spawn
     void spawnDE(int x, int Arr[][Rows],char cArr[][Rows]); //zigg-zag spawn (even faster than spawn)
-    //http://stackoverflow.com/questions/10289197/how-to-empty-a-2d-char-array-in-c
-    void moveSpawnABC(int Arr[][Rows], int Arr2[][Rows], char cArr[][Rows], char cArr2[][Rows]);
-    void moveSpawnB(int Arr[][Rows], int Arr2[][Rows], char cArr[][Rows], char cArr2[][Rows]);
-    void moveSpawnDE(int Arr[][Rows], int Arr2[][Rows], char cArr[][Rows], char cArr2[][Rows]);
     void movementD(int x, int y, int Arr[][Rows], int Arr2[][Rows], char cArr[][Rows], char cArr2[][Rows]);
     void movementE(int x, int y, int Arr[][Rows], int Arr2[][Rows], char cArr[][Rows], char cArr2[][Rows]);
-    void deleteChar(int x, int y, int Arr[][Rows], char cArr[][Rows]); 
-
-    void updateSpawn(int Arr[][Rows], int Arr2[][Rows], char cArr[][Rows], char cArr2[][Rows], N5110 &lcd);
     
+    Stats A;
+    Stats B;
+    Stats C;
+    Stats DE;
+    
+    //the stats will increase as the game progress
     int healthA;
     int healthC;
     int healthDE;
@@ -40,9 +62,6 @@
     int spawnRateC;
     int spawnRateDE;
     
-private:
-    //column and row same as the screen resolution
-    int stopSpawnA;
 };
 
 #endif 
\ No newline at end of file