Snake vs Block Game to be run upon K64F.

Dependencies:   mbed

Revision:
54:20abd16c7d74
Parent:
50:3cf9a94a264e
Child:
56:142e9fdb77a8
--- a/main.cpp	Fri Apr 26 19:09:39 2019 +0000
+++ b/main.cpp	Fri Apr 26 19:32:57 2019 +0000
@@ -43,6 +43,7 @@
 //Constants//
 int fps = 40;  // frames per second, this will be changed in menu.
 int g_mode = 1; //selects between joystick and motion control.
+int back; //this allows us to use the back key to exit the game loop;
 
 ///////////// MAIN ////////////////
 int main()
@@ -66,7 +67,7 @@
         while (1) {
             
             game.read_input(pad, device, g_mode);
-            int back = game.update(lcd, pad, sd);
+            back = game.update(lcd, pad, sd);
             refresh_game();
             
             wait(1.0f/fps);
@@ -92,7 +93,7 @@
 
 void refresh_game()
 {
-    lcd.clear();  
+    lcd.clear();
     game.draw(lcd, pad);
     game.get_pos();
     lcd.refresh();