Snake vs Block Game to be run upon K64F.

Dependencies:   mbed

Revision:
33:249cf423fb18
Parent:
32:3a3bdeffdf62
Child:
38:30e4e6191762
diff -r 3a3bdeffdf62 -r 249cf423fb18 main.cpp
--- a/main.cpp	Mon Apr 15 13:58:09 2019 +0000
+++ b/main.cpp	Wed Apr 17 07:47:06 2019 +0000
@@ -15,6 +15,7 @@
 #include "FXOS8700CQ.h"
 #include "StartScreen.h"
 #include "SnakevsBlock.h"
+#include "SDFileSystem.h"
 
 /////////////// structs /////////////////
 struct UserInput {
@@ -29,6 +30,9 @@
 StartScreen _start;
 SnakevsBlock game;
 AnalogIn noisy(PTB0); //This creates a random noise which I can use to seed the random numbers.
+// Connections to SD card holder on K64F (SPI interface)
+SDFileSystem sd(PTE3, PTE1, PTE2, PTE4, "sd"); // MOSI, MISO, SCK, CS
+//Serial serial(USBTX, USBRX);  // for PC debug
 
 ///////////// prototypes //////////////
 void init();
@@ -41,13 +45,12 @@
 ///////////// MAIN ////////////////
 int main()
 {
-    
     init();
     _start.screen_saver(lcd, pad);
     _start.instruct(lcd, pad);
     _start.info(lcd, pad);
     while(1)  { //This loop is created for Play/Continue configuration
-        _start.menu_screen1(lcd, pad);
+        _start.main_menu(lcd, pad, sd);
         fps = _start.fps;
          // start the game
         refresh_game();
@@ -58,7 +61,7 @@
         while (1) {
             
             game.read_input(pad);
-            int back = game.update(pad);
+            int back = game.update(pad, sd);
             refresh_game();
             
             wait(1.0f/fps);