ELEC2645 (2018/19) / Mbed 2 deprecated ml17z4c_attempt2

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Food.h Source File

Food.h

00001 #include "mbed.h"
00002 #include "N5110.h"
00003 #include "Gamepad.h"
00004 
00005 /** The Food class
00006 * @brief generate a position of food randomly
00007 * @author ZIYI CHEN
00008 * @date May 2019
00009 */
00010 
00011 class Food
00012 {
00013 public:
00014 
00015     /**Constructor*/
00016     Food();
00017     /**Destructor*/
00018     ~Food();
00019 
00020 
00021     /** Init function
00022     * @param set the position of the food (x,y)
00023     */
00024     void init(int x, int y);
00025 
00026     /** Gets  x coordinate of the food
00027     * @return X coordinate
00028     */
00029     int xcoordinate();
00030 
00031     /** Gets  y coordinate of the food
00032     * @return Y coordinate
00033     */
00034     int ycoordinate();
00035 
00036     /**Generate the location of the food randomly*/
00037     void random();
00038     /**the integer variables _x and _y*/
00039     int _x;
00040     int _y;
00041 
00042 
00043 
00044 };