ELEC2645 (2019/20)
/
ELEC2645_Project_el18jb
test 1 doc
Player/Player.h
- Committer:
- joebarhouch
- Date:
- 2020-04-10
- Revision:
- 2:f22cb01c43bc
- Child:
- 3:e4e1cbf750b6
File content as of revision 2:f22cb01c43bc:
#ifndef PLAYER_H #define PLAYER_H #include "mbed.h" #include "N5110.h" #include "Gamepad.h" #include "Bitmap.h" 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 { public: Player(); ~Player(); void init(); bool health; bool jump(); bool is_jumping(); bool dir(); void draw(N5110 &lcd); private: int _vx; int _vy; int _playerX; int _playerY; bool _direction; bool _jmp; }; #endif