JianWei Lee
/
project_game
Meteor defense project
Diff: Spawn/Spawn.cpp
- Revision:
- 40:3a0c66a0e10e
- Parent:
- 39:f92b93efbc72
- Child:
- 41:1b396334256b
diff -r f92b93efbc72 -r 3a0c66a0e10e Spawn/Spawn.cpp --- a/Spawn/Spawn.cpp Tue Apr 25 22:26:14 2017 +0000 +++ b/Spawn/Spawn.cpp Sat Apr 29 19:27:20 2017 +0000 @@ -23,7 +23,7 @@ //printf("t = %d \n",t); srand(t); } -void Spawn::randomizeSpawn(int Arr[][Rows], char cArr[][Rows]) { +void Spawn::summon_spawn(int Arr[][Rows], char cArr[][Rows]) { //there is 4 kind of different spawn - a, b, c and d/e. if (stopSpawnA == 1) { //spawn spawnA for this row spawnA(Arr, cArr); @@ -96,9 +96,9 @@ } printf("at x=2, y=47. number is =%d \n",Arr2[2][47]); } -void Spawn::moveSpawnDE(int Arr[][Rows], int Arr2[][Rows], char cArr[][Rows], char cArr2[][Rows]) { //spawnD moves in a zig zag behavior. - for (int x = 0; x < Cols; x++) { // moves other direction when hit 'L' or 'R' of spawnC and walls. - for (int y = 0; y < Rows; y++) { //jumps over spawnA and spawnB +void Spawn::moveSpawnDE(int Arr[][Rows], int Arr2[][Rows], char cArr[][Rows], char cArr2[][Rows]) { + for (int x = 0; x < Cols; x++) { + for (int y = 0; y < Rows; y++) { if (cArr[x][y] == 'd') { //d = move left & down movementD(x, y, Arr, Arr2, cArr, cArr2); } else if ( cArr[x][y] == 'e') { //e = move right & down