ELEC2645 (2018/19) / Mbed 2 deprecated ml17z4c_attempt2

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Food.cpp Source File

Food.cpp

00001 #include "Food.h"
00002 
00003 
00004 Food::Food()
00005 {
00006 
00007 }
00008 
00009 Food::~Food()
00010 {
00011 
00012 }
00013 
00014 
00015 
00016 void Food::init(int x, int y)
00017 { 
00018     _x = x;
00019     _y = y;
00020     
00021 }
00022 
00023 int Food::xcoordinate()
00024 {
00025     return _x;
00026 }
00027 
00028 int Food::ycoordinate()
00029 {
00030     return _y;
00031 }
00032 
00033 void Food::random()
00034 {
00035     _x = rand() % 40;  
00036     _y = rand() % 20;  
00037 }