Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
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 };
Generated on Fri Jul 15 2022 14:43:24 by
1.7.2