![](/media/cache/profiles/LinkedIn_0NghoZJ.jpeg.50x50_q85.jpg)
Snake vs Block Game to be run upon K64F.
Diff: Snake/Snake.cpp
- Revision:
- 17:54e13faeaf64
- Parent:
- 16:7b474f873683
- Child:
- 18:b391caa5754c
--- a/Snake/Snake.cpp Fri Apr 05 05:46:11 2019 +0000 +++ b/Snake/Snake.cpp Fri Apr 05 06:28:13 2019 +0000 @@ -28,7 +28,7 @@ } -void Snake::draw(Gamepad &pad, N5110 &lcd, int length) +int Snake::draw(Gamepad &pad, N5110 &lcd, int length) { if(m == 0){ _x = WIDTH/2; //Spawns player sprite near the middle of the screen. @@ -225,6 +225,14 @@ lcd.drawSprite(_xm,_ym,3,3,(int *)snake_sprite); lcd.drawSprite(_xn,_yn,3,3,(int *)snake_sprite); } + else if(length > 15) { + lcd.clear(); + lcd.printString("Level Complete",0,1); + lcd.refresh(); + wait(1); + length = 3; + } + return length; }