ZIYI CHEN ml17z4c 201214999
Dependencies: mbed
Diff: Food/Food.h
- Revision:
- 13:08bdb4cffacd
- Child:
- 14:60c31d25d895
diff -r 1106cd853157 -r 08bdb4cffacd Food/Food.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Food/Food.h Thu May 09 14:36:47 2019 +0000 @@ -0,0 +1,44 @@ +#include "mbed.h" +#include "N5110.h" +#include "Gamepad.h" + +/** The Food class +* @brief generate a position of food randomly +* @author ZIYI CHEN +* @date may 2019 +*/ + +class Food +{ +public: + + /**Constructor*/ + Food(); + /**Destructor*/ + ~Food(); + + + /** Init function + * @param set the position of the food (x,y) + */ + void init(int x, int y); + + /** Gets x coordinate of the food + * @return X coordinate + */ + int xcoordinate(); + + /** Gets y coordinate of the food + * @return Y coordinate + */ + int ycoordinate(); + + /**Generate the location of the food randomly*/ + void random(); + /**the integer variables _x and _y*/ + int _x; + int _y; + + + +}; \ No newline at end of file