Finished the game

Dependencies:   mbed

Welcome to Snake

See that the LCD is on and press start to play

The snake is in the middle of the screen, move the analogue up, down, right, left to move the snake in those directions. Note that snake doesn't travel diagonally.

Move the snake to get as much food as possible, there is plenty of food as you will find out

Beware, snake will die if you run its head into the walls, or into its body

Take care to keep moving snake fast, its body will catch up with its head and cause it to die!!!!!!

Have fun, and get that snake as long as possible :)

Revision:
11:c77c90ed0ad8
Parent:
10:dda2f2fd8b71
Child:
12:d16d154af362
--- a/main.cpp	Thu Jun 04 19:38:47 2020 +0000
+++ b/main.cpp	Fri Jun 05 12:51:30 2020 +0000
@@ -91,12 +91,23 @@
     lcd.refresh();
      
     // wait flashing LEDs until start button is pressed 
-    while ( pad.start_held() == false) {
-        lcd.setContrast( pad.read_pot1());
-        pad.leds_on();
-        wait(0.1);
-        pad.leds_off();
-        wait(0.1);
+while ( pad.start_held() == false) {
+    lcd.setContrast( pad.read_pot1());
+    pad.leds_off();
+    wait(0.1);
+    pad.led(1,1);
+    wait(0.1);
+    pad.led(2,1);
+    wait(0.1);
+    pad.led(3,1);
+    wait(0.1);
+    pad.led(6,1);
+    wait(0.1);
+    pad.led(5,1);
+    wait(0.1);
+    pad.led(4,1);
+    wait(0.1);
+    pad.leds_off();
     }
 
 }