ELEC2645 (2019/20)
/
ELEC2645_Project_el18jb
test 1 doc
Player/Player.h@3:e4e1cbf750b6, 2020-05-18 (annotated)
- Committer:
- joebarhouch
- Date:
- Mon May 18 16:06:27 2020 +0000
- Revision:
- 3:e4e1cbf750b6
- Parent:
- 2:f22cb01c43bc
- Child:
- 5:928c2eee4109
Character movement with game engine
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
joebarhouch | 2:f22cb01c43bc | 1 | #ifndef PLAYER_H |
joebarhouch | 2:f22cb01c43bc | 2 | #define PLAYER_H |
joebarhouch | 2:f22cb01c43bc | 3 | |
joebarhouch | 2:f22cb01c43bc | 4 | #include "mbed.h" |
joebarhouch | 2:f22cb01c43bc | 5 | #include "N5110.h" |
joebarhouch | 2:f22cb01c43bc | 6 | #include "Gamepad.h" |
joebarhouch | 2:f22cb01c43bc | 7 | #include "Bitmap.h" |
joebarhouch | 2:f22cb01c43bc | 8 | |
joebarhouch | 2:f22cb01c43bc | 9 | |
joebarhouch | 2:f22cb01c43bc | 10 | |
joebarhouch | 2:f22cb01c43bc | 11 | |
joebarhouch | 2:f22cb01c43bc | 12 | class Player |
joebarhouch | 2:f22cb01c43bc | 13 | { |
joebarhouch | 2:f22cb01c43bc | 14 | public: |
joebarhouch | 2:f22cb01c43bc | 15 | Player(); |
joebarhouch | 2:f22cb01c43bc | 16 | ~Player(); |
joebarhouch | 2:f22cb01c43bc | 17 | |
joebarhouch | 3:e4e1cbf750b6 | 18 | void init(int x, int y); |
joebarhouch | 3:e4e1cbf750b6 | 19 | //bool health; |
joebarhouch | 3:e4e1cbf750b6 | 20 | bool jump(Gamepad &pad); |
joebarhouch | 3:e4e1cbf750b6 | 21 | //bool is_jumping(); |
joebarhouch | 2:f22cb01c43bc | 22 | void draw(N5110 &lcd); |
joebarhouch | 3:e4e1cbf750b6 | 23 | void update(Direction d, float mag); |
joebarhouch | 3:e4e1cbf750b6 | 24 | Vector2D get_pos(); |
joebarhouch | 2:f22cb01c43bc | 25 | |
joebarhouch | 2:f22cb01c43bc | 26 | private: |
joebarhouch | 2:f22cb01c43bc | 27 | int _vx; |
joebarhouch | 2:f22cb01c43bc | 28 | int _vy; |
joebarhouch | 2:f22cb01c43bc | 29 | int _playerX; |
joebarhouch | 2:f22cb01c43bc | 30 | int _playerY; |
joebarhouch | 2:f22cb01c43bc | 31 | bool _jmp; |
joebarhouch | 3:e4e1cbf750b6 | 32 | char _dir; |
joebarhouch | 2:f22cb01c43bc | 33 | |
joebarhouch | 2:f22cb01c43bc | 34 | }; |
joebarhouch | 2:f22cb01c43bc | 35 | |
joebarhouch | 2:f22cb01c43bc | 36 | #endif |