![](/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:
- 1:b9f3b7d869d8
- Child:
- 2:0bd6711eae26
diff -r 1217c9dd0290 -r b9f3b7d869d8 Snake/Snake.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Snake/Snake.cpp Wed May 08 19:32:05 2019 +0000 @@ -0,0 +1,17 @@ +#include "Snake.h" + +Snake::Snake() { +} + +Snake::~Snake() { +} + +void Snake::init() { + _snake_posX = WIDTH/2 - 2; // Snake head set to horizontal centre + _snake_posY = HEIGHT/2 - 2; // Snake head set to vertical centre +} + +void Snake::draw_head(N5110 &lcd) { + lcd.drawRect(_snake_posX,_snake_posY,4,4,FILL_BLACK); // Draws snake head +} +