JianWei Lee
/
project_game
Meteor defense project
Spawn/Spawn.h@23:6d197a452d7c, 2017-04-13 (annotated)
- Committer:
- jasper0712
- Date:
- Thu Apr 13 14:05:25 2017 +0000
- Revision:
- 23:6d197a452d7c
- Parent:
- 22:2e75b50b26f0
- Child:
- 24:d6187d39f09b
got spawnD up working. seems like theres still a lot need to be polished.
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 | 1:f5cda0674f24 | 13 | class Spawn |
jasper0712 | 1:f5cda0674f24 | 14 | { |
jasper0712 | 1:f5cda0674f24 | 15 | public: |
jasper0712 | 1:f5cda0674f24 | 16 | Spawn(); |
jasper0712 | 1:f5cda0674f24 | 17 | ~Spawn(); |
jasper0712 | 1:f5cda0674f24 | 18 | //spawnHealth |
jasper0712 | 18:d82059ce929b | 19 | void init(); |
jasper0712 | 20:32f115462bbc | 20 | void randomizeSpawn(int Arr[][Rows],char cArr[][Rows]); |
jasper0712 | 23:6d197a452d7c | 21 | void spawnA(int Arr[][Rows],char cArr[][Rows]); //normal spawn |
jasper0712 | 23:6d197a452d7c | 22 | void spawnB(int x, int Arr[][Rows],char cArr[][Rows]); //fast moving spawn |
jasper0712 | 23:6d197a452d7c | 23 | void spawnC(int Arr[][Rows],char cArr[][Rows]); //tanky spawn |
jasper0712 | 23:6d197a452d7c | 24 | void spawnD(int x, int Arr[][Rows],char cArr[][Rows]); //zigg-zag spawn |
jasper0712 | 13:38cbce17d7d7 | 25 | //http://stackoverflow.com/questions/10289197/how-to-empty-a-2d-char-array-in-c |
jasper0712 | 20:32f115462bbc | 26 | void moveSpawnABC(int Arr[][Rows], int Arr2[][Rows], char cArr[][Rows], char cArr2[][Rows]); |
jasper0712 | 20:32f115462bbc | 27 | void moveSpawnB(int Arr[][Rows], int Arr2[][Rows], char cArr[][Rows], char cArr2[][Rows]); |
jasper0712 | 23:6d197a452d7c | 28 | void moveSpawnD(int Arr[][Rows], int Arr2[][Rows], char cArr[][Rows], char cArr2[][Rows]); |
jasper0712 | 23:6d197a452d7c | 29 | void movementD1(int x, int y, int Arr[][Rows], int Arr2[][Rows], char cArr[][Rows], char cArr2[][Rows]); |
jasper0712 | 23:6d197a452d7c | 30 | void movementD2(int x, int y, int Arr[][Rows], int Arr2[][Rows], char cArr[][Rows], char cArr2[][Rows]); |
jasper0712 | 20:32f115462bbc | 31 | void deleteChar(int x, int y, int Arr[][Rows], char cArr[][Rows]); |
jasper0712 | 20:32f115462bbc | 32 | |
jasper0712 | 20:32f115462bbc | 33 | void updateSpawn(int Arr[][Rows], int Arr2[][Rows], char cArr[][Rows], char cArr2[][Rows], N5110 &lcd); |
jasper0712 | 6:a554424e4517 | 34 | |
jasper0712 | 18:d82059ce929b | 35 | int healthA; |
jasper0712 | 18:d82059ce929b | 36 | int healthC; |
jasper0712 | 23:6d197a452d7c | 37 | int healthD; |
jasper0712 | 18:d82059ce929b | 38 | int spawnRateA; |
jasper0712 | 18:d82059ce929b | 39 | int spawnRateB; |
jasper0712 | 18:d82059ce929b | 40 | int spawnRateC; |
jasper0712 | 22:2e75b50b26f0 | 41 | int spawnRateD; |
jasper0712 | 22:2e75b50b26f0 | 42 | |
jasper0712 | 1:f5cda0674f24 | 43 | private: |
jasper0712 | 1:f5cda0674f24 | 44 | //column and row same as the screen resolution |
jasper0712 | 13:38cbce17d7d7 | 45 | int stopSpawnA; |
jasper0712 | 1:f5cda0674f24 | 46 | }; |
jasper0712 | 1:f5cda0674f24 | 47 | |
jasper0712 | 3:6b50fe9d3848 | 48 | #endif |