Ahmed Adamjee
/
SnakeVSBlock
Snake vs Block Game to be run upon K64F.
Diff: SnakevsBlock/SnakevsBlock.h
- Revision:
- 7:48ba87cd79b5
- Child:
- 9:d1d79d4ee673
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SnakevsBlock/SnakevsBlock.h Tue Mar 26 14:45:15 2019 +0000 @@ -0,0 +1,59 @@ +#ifndef SNAKEVSBLOCK_H +#define SNAKEVSBLOCK_H + +#include "mbed.h" +#include "N5110.h" +#include "Gamepad.h" +#include "Snake.h" + +class SnakevsBlock +{ + public: + SnakevsBlock(); + ~SnakevsBlock(); + + /** Initialise Game Machine + * + * This function initialises the game machine. + */ + void init( ); + + /** Read Input + * + * This function obtains numeric data from the gamepads joystick. + */ + void read_input(Gamepad &pad); + + /** Update + * + * This function contains the update functions of the other libraries used in the game. + */ + void update(Gamepad &pad); + + /** Draw + * + * This function contains the draw functions of the other libraries used in the game. + */ + void draw(N5110 &lcd, Gamepad &pad); + + /** Get Position + * + * This function contains the Get Position functions of the otehr libraries used in the game. + */ + void get_pos(); + + + int snakex; + int snakey; + int length; + + private: + + Snake _s; + int _speed; + Direction _d; + float _mag; + int n; + +}; +#endif \ No newline at end of file