JianWei Lee
/
project_game
Meteor defense project
GameEngine/GameEngine.h@32:580d74825810, 2017-04-21 (annotated)
- Committer:
- jasper0712
- Date:
- Fri Apr 21 12:00:17 2017 +0000
- Revision:
- 32:580d74825810
- Parent:
- 31:1c0e47931e84
- Child:
- 34:6ac9541d4c31
bomb is still making the game crash and i have no fucking idea why
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jasper0712 | 4:4145abd09075 | 1 | #ifndef GAMEENGINE_H |
jasper0712 | 4:4145abd09075 | 2 | #define GAMEENGINE_H |
jasper0712 | 4:4145abd09075 | 3 | |
jasper0712 | 4:4145abd09075 | 4 | #include "mbed.h" |
jasper0712 | 4:4145abd09075 | 5 | #include "N5110.h" |
jasper0712 | 4:4145abd09075 | 6 | #include "Gamepad.h" |
jasper0712 | 4:4145abd09075 | 7 | #include "Weapon.h" |
jasper0712 | 4:4145abd09075 | 8 | #include "Spawn.h" |
jasper0712 | 29:6632dd9c48d8 | 9 | #include "GUI.h" |
jasper0712 | 4:4145abd09075 | 10 | |
jasper0712 | 4:4145abd09075 | 11 | #define Rows 48 |
jasper0712 | 4:4145abd09075 | 12 | #define Cols 84 |
jasper0712 | 4:4145abd09075 | 13 | |
jasper0712 | 4:4145abd09075 | 14 | |
jasper0712 | 4:4145abd09075 | 15 | class GameEngine |
jasper0712 | 4:4145abd09075 | 16 | { |
jasper0712 | 4:4145abd09075 | 17 | |
jasper0712 | 4:4145abd09075 | 18 | public: |
jasper0712 | 4:4145abd09075 | 19 | GameEngine(); |
jasper0712 | 4:4145abd09075 | 20 | ~GameEngine(); |
jasper0712 | 4:4145abd09075 | 21 | void drawSpawn(N5110 &lcd); |
jasper0712 | 5:c74bbdda06f4 | 22 | void drawLaserPlayer(Gamepad &pad, N5110 &lcd); |
jasper0712 | 32:580d74825810 | 23 | void checkGameRule(Gamepad &pad, N5110 &lcd); |
jasper0712 | 21:e5585569a938 | 24 | void gameWave(); //not yet started |
jasper0712 | 14:064b8d7f348d | 25 | void bombAndShield(Gamepad &pad, N5110 &lcd); |
jasper0712 | 26:140515d80457 | 26 | void updateArray(); |
jasper0712 | 21:e5585569a938 | 27 | |
jasper0712 | 32:580d74825810 | 28 | void init(int w); |
jasper0712 | 21:e5585569a938 | 29 | void update(Gamepad &pad, N5110 &lcd); |
jasper0712 | 28:450ab72fabdc | 30 | void weapUpgrade(Gamepad &pad, N5110 &lcd); |
jasper0712 | 32:580d74825810 | 31 | void startingMenu(Gamepad &pad, N5110 &lcd); |
jasper0712 | 26:140515d80457 | 32 | |
jasper0712 | 32:580d74825810 | 33 | int doneUpgrade; |
jasper0712 | 28:450ab72fabdc | 34 | |
jasper0712 | 28:450ab72fabdc | 35 | int Array[Cols][Rows]; //main |
jasper0712 | 20:32f115462bbc | 36 | int Array2[Cols][Rows]; // secondary |
jasper0712 | 19:7ccbb19703f9 | 37 | //this char array to differentiate the 4 different kind of spawn - a, b, c and d. |
jasper0712 | 20:32f115462bbc | 38 | char charArray[Cols][Rows]; //used as main array |
jasper0712 | 28:450ab72fabdc | 39 | char charArray2[Cols][Rows]; //secondary array |
jasper0712 | 28:450ab72fabdc | 40 | |
jasper0712 | 9:4c4d787c7a8b | 41 | |
jasper0712 | 25:edd6a95607b1 | 42 | |
jasper0712 | 4:4145abd09075 | 43 | private: |
jasper0712 | 5:c74bbdda06f4 | 44 | Weapon weap; |
jasper0712 | 17:53aedd20155a | 45 | Weapon _d1; |
jasper0712 | 17:53aedd20155a | 46 | Weapon _d2; |
jasper0712 | 4:4145abd09075 | 47 | Spawn spa; |
jasper0712 | 29:6632dd9c48d8 | 48 | GUI _gui; |
jasper0712 | 28:450ab72fabdc | 49 | |
jasper0712 | 4:4145abd09075 | 50 | int drawit; |
jasper0712 | 32:580d74825810 | 51 | int ledNumber; |
jasper0712 | 13:38cbce17d7d7 | 52 | |
jasper0712 | 4:4145abd09075 | 53 | }; |
jasper0712 | 4:4145abd09075 | 54 | |
jasper0712 | 4:4145abd09075 | 55 | #endif |