Meteor defense project

Dependencies:   N5110 mbed

Revision:
44:aa086363d09f
Parent:
41:1b396334256b
Child:
45:1a013017ae92
--- a/Spawn/Spawn.cpp	Mon May 01 17:55:38 2017 +0000
+++ b/Spawn/Spawn.cpp	Wed May 03 21:00:43 2017 +0000
@@ -10,13 +10,13 @@
 
 }
 void Spawn::init(int w) {
-    A.health = 7 + 4 * w;
-    A.spawnRate = 35 + w;
+    A.health = 8 + 4 * w;
+    A.spawnRate = 47 + w;
     B.health = 1000; //health B wont change
     B.spawnRate = 1 + w / 2;
-    C.health = 150 + w * 10;
-    C.spawnRate = 1 + w;
-    DE.health = 20 + w;
+    C.health = 170 + w * 10;
+    C.spawnRate = 2 + w;
+    DE.health = 20 + 2 * w;
     DE.spawnRate = 1 + w / 2;
     //randomise the seed. To get different spawn pattern all the time.
     int t = time(NULL);
@@ -64,7 +64,7 @@
         if (TrueFalseC) {
             Arr[x][1] = C.health;
             cArr[x][1] = 'c';
-            cArr[x-1][0] = 'l';
+            cArr[x-1][0] = 'l'; //l and r given to spawn C to give it a bigger hit box for laser 
             cArr[x+1][0] = 'r';
         }
     }
@@ -116,7 +116,7 @@
         if (cArr[x-1][y+1] == 'l' || cArr[x-1][y+1] == 'r') {
             //printf("char = %c \n",cArr[x-1][y+1]);
         }
-        cArr2[x+1][y+1] = 'e'; Arr2[x+1][y+1] = Arr[x][y]; //start moving right & down
+        cArr2[x+1][y+1] = 'e'; Arr2[x+1][y+1] = Arr[x][y]; //start moving right & down (change direction)
         cArr2[x][y] = '\0'; Arr2[x][y] = 0;
         //printf("spawn d at x = %d is shifted to e \n",x);
     } else { //if nothing is blocking the path
@@ -131,7 +131,7 @@
         cArr2[x][y] = '\0'; Arr2[x][y] = 0;
         //printf("jump over at [%d][%d] \n",x+1,y+1);
     } else if (x == 0 || x == 83 || cArr[x+1][y+1] == 'l' || cArr[x+1][y+1] == 'r' || cArr[x+1][y+1] == 'm') { //if it hits either side of the wall or 'l' or 'r' or 'm'.
-        cArr2[x-1][y+1] = 'd'; Arr2[x-1][y+1] = Arr[x][y]; //start moving left & down
+        cArr2[x-1][y+1] = 'd'; Arr2[x-1][y+1] = Arr[x][y]; //start moving left & down (move other direction)
         cArr2[x][y] = '\0'; Arr2[x][y] = 0;
         //printf("spawn d at x = %d is shifted to e \n",x);
     } else { //if nothing is blocking the path