ELEC2645 (2019/20)
/
ELEC2645_Project_el18jb
test 1 doc
Diff: Player/Player.h
- Revision:
- 3:e4e1cbf750b6
- Parent:
- 2:f22cb01c43bc
- Child:
- 5:928c2eee4109
diff -r f22cb01c43bc -r e4e1cbf750b6 Player/Player.h --- a/Player/Player.h Fri Apr 10 19:07:13 2020 +0000 +++ b/Player/Player.h Mon May 18 16:06:27 2020 +0000 @@ -8,35 +8,6 @@ - int player_sprite[] = { - 1,1,1,1,1,1,1,0,0, - 1,1,1,1,1,1,1,0,0, - 1,1,1,0,1,0,1,0,0, - 1,1,1,0,1,0,1,1,1, - 1,1,1,0,1,0,1,1,0, - 1,1,1,1,1,1,1,0,0, - 0,1,1,0,1,1,0,0,0, - 0,1,1,0,1,1,0,0,0 -}; - - - int player_inv_sprite[] = { - 0,0,1,1,1,1,1,1,1, - 0,0,1,1,1,1,1,1,1, - 0,0,1,0,1,0,1,1,1, - 1,1,1,0,1,0,1,1,1, - 0,1,1,0,1,0,1,1,1, - 0,1,1,1,1,1,1,1,1, - 0,0,0,1,1,0,1,1,0, - 0,0,0,1,1,0,1,1,0 -}; - - - -Bitmap player(player_sprite, 8, 9); -Bitmap player_inv(player_inv_sprite, 8, 9); - - class Player { @@ -44,20 +15,21 @@ Player(); ~Player(); - void init(); - bool health; - bool jump(); - bool is_jumping(); - bool dir(); + void init(int x, int y); + //bool health; + bool jump(Gamepad &pad); + //bool is_jumping(); void draw(N5110 &lcd); + void update(Direction d, float mag); + Vector2D get_pos(); private: int _vx; int _vy; int _playerX; int _playerY; - bool _direction; bool _jmp; + char _dir; };