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.
Food.h
00001 #include "mbed.h" 00002 #include "N5110.h" 00003 #include "Gamepad.h" 00004 00005 00006 /** The Food class 00007 * @brief Stores the position of the food to be eaten and randomises its location 00008 * @author Andrew J. Moore 00009 * @date May, 2018 00010 */ 00011 00012 class Food 00013 { 00014 public: 00015 00016 /** Constructor */ 00017 Food(); 00018 00019 /** Destructor */ 00020 ~Food(); 00021 00022 /** Initialisation function 00023 * @param the inital starting position for the food, given in X and Y (int) 00024 */ 00025 void init(int x, int y); 00026 00027 /** Gets the current X coordinate of the food 00028 * @return the current X coordinate 00029 */ 00030 int getX(); 00031 00032 00033 /** Gets the current Y coordinate of the food 00034 * @return the current Y coordinate 00035 */ 00036 int getY(); 00037 00038 00039 /** Randomises the current location of the food */ 00040 void random(); 00041 00042 private: 00043 00044 //Private Variables 00045 int _x; 00046 int _y; 00047 };
Generated on Sun Jul 17 2022 04:24:16 by
1.7.2