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.
Diff: food/food.cpp
- Revision:
- 2:430dcf420840
diff -r 0648f0052827 -r 430dcf420840 food/food.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/food/food.cpp Fri Jun 05 22:51:49 2020 +0000 @@ -0,0 +1,25 @@ +#include "food.h" + +Food::Food() +{ +} + +Food::~Food() +{ +} + +void Food::init(){ + fo_x = 16; + fo_y = 38; + + chng_food = false; +} + +void Food::food_location(N5110 &lcd){ + if (chng_food == true){ + chng_food = false; + lcd.setPixel(fo_x, fo_y, 0); + fo_x = rand()%84; + fo_y = rand()%48; + } +}