Peng Jingran
/
Snake_copy
ccc
Food/Food.cpp
- Committer:
- pjr
- Date:
- 2020-05-11
- Revision:
- 14:f898d37428b1
- Parent:
- 13:9a6aff771774
File content as of revision 14:f898d37428b1:
#include "Food.h" pos food; Food::Food(){ } Food::~Food(){ } void Food::init(){ food.x=7; food.y=30; }//set the initial foof position void Food::draw(N5110 &lcd){ lcd.setPixel(food.x,food.y); }//draw the food on the screen void Food::response(){ srand(time(NULL)); food.x=(rand()%35)+5; food.y=(rand()%28)+3; } pos Food::returnPos(){ pos a = { food.x, food.y}; return a; }//report position of food