Ahmed Adamjee
/
SnakeVSBlock
Snake vs Block Game to be run upon K64F.
Diff: GameObjects/Barriers/Barriers.h
- Revision:
- 81:4c1641e10dcd
- Child:
- 83:329da564799a
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/GameObjects/Barriers/Barriers.h Mon May 06 09:05:09 2019 +0000 @@ -0,0 +1,55 @@ +#ifndef BARRIERS_H +#define BARRIERS_H + +#include "mbed.h" +#include "N5110.h" +#include "Gamepad.h" + + +class Barriers +{ + public: + Barriers(); + ~Barriers(); + /** Initialise Barriers + * + * This function initialises the Barriers library. + */ + void init(); + + /** Draw + * + * This function draws the Barriers onto the screen. + */ + void draw(N5110 &lcd, int b_y); + + /** Update + * + * This function updates the position of the Barriers as they move down the screen. + */ + void update(int blockgap); + + /** Get Position + * + * This function obtains the coordinates of the top-left pixel in the Barriers sprites. + */ + Vector2D get_pos(); + + /** Set Position + * + * This function is used to change the position of the barrier to specific coordinates when called. + */ + void set_pos(Vector2D p); + + + Vector2D velocity; + + private: + int reset; + int _barx; //barrier x + int _bary; //barrier y + int _barriergap; + int _blockgap; + +}; +#endif \ No newline at end of file