![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Final Submission. I have read and agreed with Statement of Academic Integrity.
Dependencies: mbed Gamepad N5110 Joystick
Diff: Snake/Snake.cpp
- Revision:
- 3:660de4311976
- Parent:
- 2:0bd6711eae26
- Child:
- 10:aedca0082855
--- a/Snake/Snake.cpp Wed May 08 21:26:27 2019 +0000 +++ b/Snake/Snake.cpp Thu May 09 00:19:35 2019 +0000 @@ -25,3 +25,18 @@ int Snake::get_snake_posY() { return _snake_posY; } + +void Snake::set_food_posX(int food_posX) {_food_posX = food_posX;} // mutators allow changing snake position +void Snake::set_food_posY(int food_posY) {_food_posY = food_posY;} + +// accessors +int Snake::get_food_posX() { + return _food_posX; +} +int Snake::get_food_posY() { + return _food_posY; +} + +void Snake::draw_food(N5110 &lcd) { + lcd.drawRect(_food_posX,_food_posY,4,4,FILL_BLACK); +} \ No newline at end of file