ELEC2645 (2019/20)
/
ELEC2645_Project_el18jb
test 1 doc
Diff: Player/Player.h
- Revision:
- 14:58887d7e1072
- Parent:
- 11:b3024ab59fa5
diff -r cb5ed2f0cbd5 -r 58887d7e1072 Player/Player.h --- a/Player/Player.h Wed May 27 04:36:22 2020 +0000 +++ b/Player/Player.h Wed May 27 07:48:27 2020 +0000 @@ -6,26 +6,46 @@ #include "Gamepad.h" #include "Bitmap.h" +#define GRAVITY 4 +/** Player Class + * @brief Class to control the player + * @author Joe Barhouch + * @author 201291584 + */ class Player { public: + /** Constructor */ Player(); + /** Deconstructor */ ~Player(); - + /** initialise the player + *@param inital X position + *@param inital Y position + */ void init(int x, int y); - //bool health; - - //bool is_jumping(); + /** Draw on the lcd + *@param lcd + */ void draw(N5110 &lcd); - bool floorCollide(); + /** Update inputs + *@param Direction d of the Joystick + *@param Magnitude of joystick position + *@param Y position of platforms + *@param fall true if the player is falling + *@param jump is true f player is jumping + */ void update(Direction d, float mag, int Ypos, bool fall, bool jump); + /** set position of enemies + *@return Vector2D of the position + */ Vector2D get_pos(); - + private: int _vx; int _vy; @@ -35,7 +55,7 @@ char _dir; Timer t; bool f; - + }; - + #endif \ No newline at end of file