Snake vs Block Game to be run upon K64F.

Dependencies:   mbed

Revision:
2:83e85dea3c89
Parent:
1:32e312688a65
Child:
3:fbb1fa853f09
--- a/main.cpp	Tue Mar 12 10:34:38 2019 +0000
+++ b/main.cpp	Tue Mar 12 13:05:30 2019 +0000
@@ -18,71 +18,83 @@
 N5110 lcd(PTC9,PTC0,PTC7,PTD2,PTD1,PTC11);
 Gamepad pad;
 FXOS8700CQ device(I2C_SDA,I2C_SCL);
-SnakevsBlock game;
+//SnakevsBlock game;
 
 ///////////// prototypes ///////////////
 void init();
 void screen_saver();
-void menu_page();
+void menu_screen();
 void refresh_game();
 
+//Constants//
+int fps = 7;  // frames per second
+
 ///////////////My Sprite////////////////
 int sprite[48][84] = {
     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
     {0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,1,0,0,0,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
     {0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,1,1,1,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
-    {0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,1,1,0,1,0,1,1,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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    int fps = 20;  // frames per second
-
+    
     init();
     screen_saver();  // logo
      // start the game
@@ -92,8 +104,8 @@
     // snakeVSblock - detect input respect to the menu options, and update data and refresh screen
     while (1) {
         
-        game.read_input(pad);
-        game.update(pad);
+        //game.read_input(pad);
+        //game.update(pad);
         refresh_game();
         
         wait(1.0f/fps);
@@ -142,13 +154,34 @@
 }
 void menu_screen()
 {
+    lcd.clear();
+    lcd.printString("Created BY",8,1);
+    lcd.printString("Ahmed",24,3);
+    lcd.printString("Adamjee",20,4);
+    lcd.printString("201161436",15,5);
+    lcd.refresh();
+    wait(3);
+    lcd.clear();
+    int i=16;
+    lcd.drawSprite(50,i,7,9,(int *)arrow);
     while (1) {  //Change this to if button pressed.
-        lcd.printString("----- Main menu -----",5,1);
-        lcd.printString("Menu item 1",15,3);
-        lcd.printString("Menu item 2",15,4);
-        lcd.printString("Menu item 3",15,5);
-        lcd.printString("Menu item 4",15,6);
-        lcd.printString("Menu item 3",15,7);
+        lcd.printString("SnakeVSBlock",5,0);
+        lcd.printString("Play",0,2);
+        lcd.printString("Settings",0,3);
+        lcd.printString("Stats",0,4);
+        lcd.printString("Tutorial",0,5);
+        Direction d = pad.get_direction();
+        if((d==N)&&(i>16))  {
+                i=i-8;
+        }
+        if((d==S)&&(i<40))  {
+                i=i+8;
+        }
+        lcd.drawSprite(50,i,7,9,(int *)arrow); //Function used to draw the sprite.
+        lcd.refresh();
+        wait(1.0f/fps);
+        lcd.clear();
+        
     }
  
 }
\ No newline at end of file