ZIYI CHEN ml17z4c 201214999

Dependencies:   mbed

Food/Food.h

Committer:
ziyi11
Date:
2019-04-30
Revision:
7:8b6f175fcb0e
Child:
8:52e0506e98b8

File content as of revision 7:8b6f175fcb0e:

#include "mbed.h"
#include "N5110.h"
#include "Gamepad.h"


/** The Food class
* @brief generate a position of the food for snake 
* @author ZiYi Chen
* @date May, 2019
*/

class Food
{
public:

    /** Constructor */
    Food();
    
    /** Destructor */
    ~Food();

    /** Initialisation function
    * @param the inital starting position for the food, given in X and Y (int)
    */
    void init(int x, int y);

    /** Gets the current X coordinate of the food
    * @return the current X coordinate
    */
    int getX();
    
    
    /** Gets the current Y coordinate of the food
    * @return the current Y coordinate
    */
    int getY();
    
    
    /** Randomises the current location of the food   */
    void random();

private:

    //Private Variables
    int _x;
    int _y;
};