ELEC2645 (2019/20)
/
ELEC2645_Project_el18jb
test 1 doc
Engine/Engine.h@6:00d20886e4f8, 2020-05-25 (annotated)
- Committer:
- joebarhouch
- Date:
- Mon May 25 16:17:58 2020 +0000
- Revision:
- 6:00d20886e4f8
- Parent:
- 5:928c2eee4109
- Child:
- 7:530ca713d2b2
Implements map as an array of platforms for easier collision
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 | 3:e4e1cbf750b6 | 9 | |
joebarhouch | 3:e4e1cbf750b6 | 10 | |
joebarhouch | 6:00d20886e4f8 | 11 | void drawMap(N5110 &lcd); |
joebarhouch | 6:00d20886e4f8 | 12 | |
joebarhouch | 3:e4e1cbf750b6 | 13 | class Engine |
joebarhouch | 3:e4e1cbf750b6 | 14 | { |
joebarhouch | 3:e4e1cbf750b6 | 15 | |
joebarhouch | 3:e4e1cbf750b6 | 16 | public: |
joebarhouch | 3:e4e1cbf750b6 | 17 | Engine(); |
joebarhouch | 3:e4e1cbf750b6 | 18 | ~Engine(); |
joebarhouch | 3:e4e1cbf750b6 | 19 | |
joebarhouch | 3:e4e1cbf750b6 | 20 | void init(); |
joebarhouch | 3:e4e1cbf750b6 | 21 | void read_input(Gamepad &pad); |
joebarhouch | 3:e4e1cbf750b6 | 22 | void update(Gamepad &pad); |
joebarhouch | 3:e4e1cbf750b6 | 23 | void draw(N5110 &lcd); |
joebarhouch | 6:00d20886e4f8 | 24 | bool floorCollide(); |
joebarhouch | 6:00d20886e4f8 | 25 | |
joebarhouch | 3:e4e1cbf750b6 | 26 | |
joebarhouch | 6:00d20886e4f8 | 27 | private: |
joebarhouch | 3:e4e1cbf750b6 | 28 | void ennemyCollide(Gamepad &pad); |
joebarhouch | 6:00d20886e4f8 | 29 | |
joebarhouch | 6:00d20886e4f8 | 30 | //player object |
joebarhouch | 3:e4e1cbf750b6 | 31 | Player _p; |
joebarhouch | 3:e4e1cbf750b6 | 32 | // player coordinates |
joebarhouch | 3:e4e1cbf750b6 | 33 | int _px; |
joebarhouch | 3:e4e1cbf750b6 | 34 | int _py; |
joebarhouch | 3:e4e1cbf750b6 | 35 | |
joebarhouch | 3:e4e1cbf750b6 | 36 | Direction _d; |
joebarhouch | 3:e4e1cbf750b6 | 37 | float _mag; |
joebarhouch | 6:00d20886e4f8 | 38 | bool _collision; |
joebarhouch | 3:e4e1cbf750b6 | 39 | |
joebarhouch | 3:e4e1cbf750b6 | 40 | }; |
joebarhouch | 3:e4e1cbf750b6 | 41 | |
joebarhouch | 3:e4e1cbf750b6 | 42 | #endif |