ELEC2645 (2017/18) / Mbed OS el16ajm

Food/Food.cpp

Committer:
Andrew_M
Date:
2018-04-30
Revision:
7:c1e0593bfc99
Parent:
5:a3a9e0417e04
Child:
15:130900e5c268

File content as of revision 7:c1e0593bfc99:

#include "Food.h"

// nothing doing in the constructor and destructor
Food::Food()
{

}

Food::~Food()
{

}

void Food::init(int x, int y)
{
    //Inital values for variables    
    _x = x;
    _y = y;
}

int Food::getX()
{
    return _x;
}

int Food::getY()
{
    return _y;
}

void Food::random()
{
    _x = rand() % 22;  
    _y = rand() % 22;  
}