ZIYI CHEN ml17z4c 201214999
Dependencies: mbed
Diff: Food/Food.h
- Revision:
- 7:8b6f175fcb0e
- Child:
- 8:52e0506e98b8
diff -r 13c43182a848 -r 8b6f175fcb0e Food/Food.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Food/Food.h Tue Apr 30 09:14:17 2019 +0000 @@ -0,0 +1,47 @@ +#include "mbed.h" +#include "N5110.h" +#include "Gamepad.h" + + +/** The Food class +* @brief generate a position of the food for snake +* @author ZiYi Chen +* @date May, 2019 +*/ + +class Food +{ +public: + + /** Constructor */ + Food(); + + /** Destructor */ + ~Food(); + + /** Initialisation function + * @param the inital starting position for the food, given in X and Y (int) + */ + void init(int x, int y); + + /** Gets the current X coordinate of the food + * @return the current X coordinate + */ + int getX(); + + + /** Gets the current Y coordinate of the food + * @return the current Y coordinate + */ + int getY(); + + + /** Randomises the current location of the food */ + void random(); + +private: + + //Private Variables + int _x; + int _y; +}; \ No newline at end of file