JianWei Lee
/
project_game
Meteor defense project
Spawn/Spawn.h@34:6ac9541d4c31, 2017-04-23 (annotated)
- Committer:
- jasper0712
- Date:
- Sun Apr 23 21:09:32 2017 +0000
- Revision:
- 34:6ac9541d4c31
- Parent:
- 32:580d74825810
- Child:
- 40:3a0c66a0e10e
did pretty much nothing dont know what to do now
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jasper0712 | 1:f5cda0674f24 | 1 | #ifndef SPAWN_H |
jasper0712 | 1:f5cda0674f24 | 2 | #define SPAWN_H |
jasper0712 | 1:f5cda0674f24 | 3 | |
jasper0712 | 1:f5cda0674f24 | 4 | #include "mbed.h" |
jasper0712 | 1:f5cda0674f24 | 5 | #include "N5110.h" |
jasper0712 | 1:f5cda0674f24 | 6 | #include "Gamepad.h" |
jasper0712 | 1:f5cda0674f24 | 7 | #include "Weapon.h" |
jasper0712 | 1:f5cda0674f24 | 8 | |
jasper0712 | 1:f5cda0674f24 | 9 | //Y rows and X columns |
jasper0712 | 1:f5cda0674f24 | 10 | #define Rows 48 |
jasper0712 | 1:f5cda0674f24 | 11 | #define Cols 84 |
jasper0712 | 1:f5cda0674f24 | 12 | |
jasper0712 | 34:6ac9541d4c31 | 13 | struct Stats { |
jasper0712 | 34:6ac9541d4c31 | 14 | int health; |
jasper0712 | 34:6ac9541d4c31 | 15 | int spawnRate; |
jasper0712 | 34:6ac9541d4c31 | 16 | }; |
jasper0712 | 34:6ac9541d4c31 | 17 | |
jasper0712 | 1:f5cda0674f24 | 18 | class Spawn |
jasper0712 | 1:f5cda0674f24 | 19 | { |
jasper0712 | 1:f5cda0674f24 | 20 | public: |
jasper0712 | 1:f5cda0674f24 | 21 | Spawn(); |
jasper0712 | 1:f5cda0674f24 | 22 | ~Spawn(); |
jasper0712 | 31:1c0e47931e84 | 23 | //spawnHealth |
jasper0712 | 32:580d74825810 | 24 | void init(int w); |
jasper0712 | 34:6ac9541d4c31 | 25 | |
jasper0712 | 25:edd6a95607b1 | 26 | void randomizeSpawn(int Arr[][Rows], char cArr[][Rows]); |
jasper0712 | 31:1c0e47931e84 | 27 | void spawnA(int Arr[][Rows],char cArr[][Rows]); //normal spawn |
jasper0712 | 31:1c0e47931e84 | 28 | void spawnB(int x, int Arr[][Rows],char cArr[][Rows]); //fast moving spawn |
jasper0712 | 31:1c0e47931e84 | 29 | void spawnC(int Arr[][Rows],char cArr[][Rows]); //tanky spawn |
jasper0712 | 31:1c0e47931e84 | 30 | void spawnDE(int x, int Arr[][Rows],char cArr[][Rows]); //zigg-zag spawn (even faster than spawn) |
jasper0712 | 30:2e2d48cbfec3 | 31 | //http://stackoverflow.com/questions/10289197/how-to-empty-a-2d-char-array-in-c |
jasper0712 | 30:2e2d48cbfec3 | 32 | void moveSpawnABC(int Arr[][Rows], int Arr2[][Rows], char cArr[][Rows], char cArr2[][Rows]); |
jasper0712 | 30:2e2d48cbfec3 | 33 | void moveSpawnB(int Arr[][Rows], int Arr2[][Rows], char cArr[][Rows], char cArr2[][Rows]); |
jasper0712 | 30:2e2d48cbfec3 | 34 | void moveSpawnDE(int Arr[][Rows], int Arr2[][Rows], char cArr[][Rows], char cArr2[][Rows]); |
jasper0712 | 24:d6187d39f09b | 35 | void movementD(int x, int y, int Arr[][Rows], int Arr2[][Rows], char cArr[][Rows], char cArr2[][Rows]); |
jasper0712 | 24:d6187d39f09b | 36 | void movementE(int x, int y, int Arr[][Rows], int Arr2[][Rows], char cArr[][Rows], char cArr2[][Rows]); |
jasper0712 | 31:1c0e47931e84 | 37 | void deleteChar(int x, int y, int Arr[][Rows], char cArr[][Rows]); |
jasper0712 | 31:1c0e47931e84 | 38 | |
jasper0712 | 31:1c0e47931e84 | 39 | void updateSpawn(int Arr[][Rows], int Arr2[][Rows], char cArr[][Rows], char cArr2[][Rows], N5110 &lcd); |
jasper0712 | 6:a554424e4517 | 40 | |
jasper0712 | 34:6ac9541d4c31 | 41 | |
jasper0712 | 22:2e75b50b26f0 | 42 | |
jasper0712 | 31:1c0e47931e84 | 43 | private: |
jasper0712 | 34:6ac9541d4c31 | 44 | |
jasper0712 | 31:1c0e47931e84 | 45 | int stopSpawnA; |
jasper0712 | 34:6ac9541d4c31 | 46 | |
jasper0712 | 34:6ac9541d4c31 | 47 | //structs to store the stats of the spawns |
jasper0712 | 34:6ac9541d4c31 | 48 | Stats A; |
jasper0712 | 34:6ac9541d4c31 | 49 | Stats B; |
jasper0712 | 34:6ac9541d4c31 | 50 | Stats C; |
jasper0712 | 34:6ac9541d4c31 | 51 | Stats DE; |
jasper0712 | 1:f5cda0674f24 | 52 | }; |
jasper0712 | 1:f5cda0674f24 | 53 | |
jasper0712 | 3:6b50fe9d3848 | 54 | #endif |