![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
test 1 doc
Engine/Engine.h@12:eb8d30593e95, 2020-05-27 (annotated)
- Committer:
- joebarhouch
- Date:
- Wed May 27 04:22:47 2020 +0000
- Revision:
- 12:eb8d30593e95
- Parent:
- 11:b3024ab59fa5
- Child:
- 13:cb5ed2f0cbd5
dying scenarios
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
joebarhouch | 3:e4e1cbf750b6 | 1 | #ifndef ENGINE_H |
joebarhouch | 3:e4e1cbf750b6 | 2 | #define ENGINE_H |
joebarhouch | 3:e4e1cbf750b6 | 3 | |
joebarhouch | 3:e4e1cbf750b6 | 4 | #include "mbed.h" |
joebarhouch | 3:e4e1cbf750b6 | 5 | #include "N5110.h" |
joebarhouch | 3:e4e1cbf750b6 | 6 | #include "Gamepad.h" |
joebarhouch | 3:e4e1cbf750b6 | 7 | #include "Player.h" |
joebarhouch | 5:928c2eee4109 | 8 | #include "Platform.h" |
joebarhouch | 8:d19b30a6cd69 | 9 | #include "Enemy.h" |
joebarhouch | 11:b3024ab59fa5 | 10 | #include "Coin.h" |
joebarhouch | 8:d19b30a6cd69 | 11 | #include <vector> |
joebarhouch | 3:e4e1cbf750b6 | 12 | |
joebarhouch | 6:00d20886e4f8 | 13 | void drawMap(N5110 &lcd); |
joebarhouch | 6:00d20886e4f8 | 14 | |
joebarhouch | 3:e4e1cbf750b6 | 15 | class Engine |
joebarhouch | 3:e4e1cbf750b6 | 16 | { |
joebarhouch | 3:e4e1cbf750b6 | 17 | |
joebarhouch | 3:e4e1cbf750b6 | 18 | public: |
joebarhouch | 3:e4e1cbf750b6 | 19 | Engine(); |
joebarhouch | 3:e4e1cbf750b6 | 20 | ~Engine(); |
joebarhouch | 3:e4e1cbf750b6 | 21 | |
joebarhouch | 3:e4e1cbf750b6 | 22 | void init(); |
joebarhouch | 3:e4e1cbf750b6 | 23 | void read_input(Gamepad &pad); |
joebarhouch | 3:e4e1cbf750b6 | 24 | void update(Gamepad &pad); |
joebarhouch | 3:e4e1cbf750b6 | 25 | void draw(N5110 &lcd); |
joebarhouch | 7:530ca713d2b2 | 26 | void floorCollide(); |
joebarhouch | 8:d19b30a6cd69 | 27 | void spawnEnemy(); |
joebarhouch | 12:eb8d30593e95 | 28 | bool enemyCollide(); |
joebarhouch | 12:eb8d30593e95 | 29 | bool fellDown(); |
joebarhouch | 12:eb8d30593e95 | 30 | bool koed(); |
joebarhouch | 11:b3024ab59fa5 | 31 | void gameOver(N5110 &lcd); |
joebarhouch | 12:eb8d30593e95 | 32 | void coinTaken(); |
joebarhouch | 12:eb8d30593e95 | 33 | |
joebarhouch | 12:eb8d30593e95 | 34 | |
joebarhouch | 8:d19b30a6cd69 | 35 | |
joebarhouch | 7:530ca713d2b2 | 36 | private: |
joebarhouch | 10:9317a62bd4d0 | 37 | |
joebarhouch | 6:00d20886e4f8 | 38 | //player object |
joebarhouch | 3:e4e1cbf750b6 | 39 | Player _p; |
joebarhouch | 3:e4e1cbf750b6 | 40 | // player coordinates |
joebarhouch | 3:e4e1cbf750b6 | 41 | int _px; |
joebarhouch | 3:e4e1cbf750b6 | 42 | int _py; |
joebarhouch | 8:d19b30a6cd69 | 43 | |
joebarhouch | 8:d19b30a6cd69 | 44 | Vector2D player; |
joebarhouch | 8:d19b30a6cd69 | 45 | |
joebarhouch | 12:eb8d30593e95 | 46 | // coin object |
joebarhouch | 12:eb8d30593e95 | 47 | Coin coin; |
joebarhouch | 12:eb8d30593e95 | 48 | |
joebarhouch | 8:d19b30a6cd69 | 49 | //gamepad |
joebarhouch | 3:e4e1cbf750b6 | 50 | Direction _d; |
joebarhouch | 3:e4e1cbf750b6 | 51 | float _mag; |
joebarhouch | 8:d19b30a6cd69 | 52 | |
joebarhouch | 8:d19b30a6cd69 | 53 | //physics |
joebarhouch | 7:530ca713d2b2 | 54 | bool _jump; |
joebarhouch | 7:530ca713d2b2 | 55 | int _Ypos; |
joebarhouch | 7:530ca713d2b2 | 56 | bool _fall; |
joebarhouch | 8:d19b30a6cd69 | 57 | bool _c; |
joebarhouch | 8:d19b30a6cd69 | 58 | |
joebarhouch | 8:d19b30a6cd69 | 59 | //enemy |
joebarhouch | 10:9317a62bd4d0 | 60 | vector <Enemy> enemies; |
joebarhouch | 8:d19b30a6cd69 | 61 | |
joebarhouch | 12:eb8d30593e95 | 62 | bool ko1; |
joebarhouch | 12:eb8d30593e95 | 63 | bool ko2; |
joebarhouch | 12:eb8d30593e95 | 64 | |
joebarhouch | 8:d19b30a6cd69 | 65 | |
joebarhouch | 3:e4e1cbf750b6 | 66 | }; |
joebarhouch | 3:e4e1cbf750b6 | 67 | |
joebarhouch | 3:e4e1cbf750b6 | 68 | #endif |