Snake vs Block Game to be run upon K64F.

Dependencies:   mbed

Revision:
84:9950d561fdf8
Parent:
83:329da564799a
Child:
87:871d9fecb593
--- a/main.cpp	Mon May 06 14:28:35 2019 +0000
+++ b/main.cpp	Mon May 06 16:15:21 2019 +0000
@@ -25,6 +25,7 @@
     init();
     _start.titleScreen();
     while(1)  { //This loop is created for Play/Continue configuration
+
         menu(); //pops up the menu by calling the StartScreen Classes.
 
         // start the game
@@ -57,14 +58,6 @@
     _set_mode_speed(); //takes all the data collected from the menu to configure the game.
 }
 
-//REFRESH GAME.
-void refresh_game()
-{
-    lcd.clear();  //clears the N5110 screen for the next frame
-    _game.draw(); //draws the next game frame
-    lcd.refresh();  //refreshes the N5110 screen to display the frame.
-}
-
 //READ AND WRITE STATS.
 void read_write_stats()
 {
@@ -104,6 +97,15 @@
     }
 }
 
+//REFRESH GAME.
+void refresh_game()
+{
+    lcd.clear();  //clears the N5110 screen for the next frame
+    _game.updateSnakeLengthAndMovement(); //updates snake length data and makes motion free by default.
+    _game.draw(); //draws the next game frame
+    lcd.refresh();  //refreshes the N5110 screen to display the frame.
+}
+
 /*
 void deinit()
 {