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.
Dependencies: mbed Gamepad N5110
Food/Food.cpp
- Committer:
- 1012754868
- Date:
- 2019-05-05
- Revision:
- 10:7cb79dbb351a
- Parent:
- 7:cafa0b96e8d3
File content as of revision 10:7cb79dbb351a:
#include "Food.h" Foodpos food; Food::Food(){ } Food::~Food(){ } void Food::init(){ food.x=50; food.y=25; } void Food::drawfood(N5110 &lcd){ lcd.setPixel(food.x,food.y); } void Food::createfood(){ srand(time(NULL)); food.x=(rand()%81)+2; food.y=(rand()%27)+10; } Foodpos Food::returnPos(){ Foodpos p = { food.x, food.y}; return p; }