ZIYI CHEN ml17z4c 201214999
Dependencies: mbed
Food/Food.h
- Committer:
- ziyi11
- Date:
- 2019-05-09
- Revision:
- 14:60c31d25d895
- Parent:
- 13:08bdb4cffacd
File content as of revision 14:60c31d25d895:
#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; };