ZIYI CHEN ml17z4c 201214999
Dependencies: mbed
Food/Food.cpp
- Committer:
- ziyi11
- Date:
- 2019-05-06
- Revision:
- 8:52e0506e98b8
- Parent:
- 7:8b6f175fcb0e
- Child:
- 9:a8b2086a46e5
File content as of revision 8:52e0506e98b8:
#include "Food.h" // nothing doing in the constructor and destructor Food::Food() { } Food::~Food() { } //No major comments are needed as all fucntions are simple and self explanatory void Food::init(int x, int y) { _x = x; _y = y; printf("Food init\n"); } int Food::getX() { return _x; } int Food::getY() { return _y; } void Food::random() { _x = rand() % 48; //randomly generates a number between 0 and 21 _y = rand() % 84; }