ELEC2645 (2019/20)
/
ELEC2645_Project_el18jb
test 1 doc
Player/Player.h@5:928c2eee4109, 2020-05-22 (annotated)
- Committer:
- joebarhouch
- Date:
- Fri May 22 01:26:24 2020 +0000
- Revision:
- 5:928c2eee4109
- Parent:
- 3:e4e1cbf750b6
- Child:
- 7:530ca713d2b2
Platform classes for map design;
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 | 5:928c2eee4109 | 23 | bool floorCollide(); |
joebarhouch | 3:e4e1cbf750b6 | 24 | void update(Direction d, float mag); |
joebarhouch | 3:e4e1cbf750b6 | 25 | Vector2D get_pos(); |
joebarhouch | 2:f22cb01c43bc | 26 | |
joebarhouch | 2:f22cb01c43bc | 27 | private: |
joebarhouch | 2:f22cb01c43bc | 28 | int _vx; |
joebarhouch | 2:f22cb01c43bc | 29 | int _vy; |
joebarhouch | 2:f22cb01c43bc | 30 | int _playerX; |
joebarhouch | 2:f22cb01c43bc | 31 | int _playerY; |
joebarhouch | 5:928c2eee4109 | 32 | bool _floorCollision; |
joebarhouch | 3:e4e1cbf750b6 | 33 | char _dir; |
joebarhouch | 2:f22cb01c43bc | 34 | |
joebarhouch | 2:f22cb01c43bc | 35 | }; |
joebarhouch | 2:f22cb01c43bc | 36 | |
joebarhouch | 2:f22cb01c43bc | 37 | #endif |