ELEC2645 (2018/19) / Mbed 2 deprecated henririgby98

Dependencies:   mbed

Revision:
9:436b88b70fdd
Parent:
8:3c15554e6723
Child:
10:2b52d7e06712
diff -r 3c15554e6723 -r 436b88b70fdd main.cpp
--- a/main.cpp	Wed May 08 22:32:36 2019 +0000
+++ b/main.cpp	Wed May 08 22:53:22 2019 +0000
@@ -24,6 +24,7 @@
 void update_game(UserInput input);
 void render();
 void welcome();
+void menu();
 void Game1Over();
 void x1_1();
 void x1_2();
@@ -83,6 +84,8 @@
     init();     // initialise and then display welcome screen...
     welcome();  // waiting for the user to start
     
+    menu();
+    
     render();  // first draw the initial frame 
     wait(1.0f/fps);  // and wait for one frame period
 
@@ -188,6 +191,26 @@
         pad.leds_off();
         wait(0.1);
     }
+    lcd.clear();  
+    lcd.refresh();
+}
+
+void menu() {
+    
+    lcd.printString("     MENU    ",0,0);
+    lcd.printString("A ==> Story ",0,1);
+    lcd.printString("B ==> Play ",0,2);
+    lcd.printString("X ==> Controls ",0,3);
+    lcd.printString("Y ==> Credits ",0,4);
+    lcd.refresh();
+     
+    // wait flashing LEDs until start button is pressed 
+    while ( pad.check_event(Gamepad::START_PRESSED) == false) {
+        pad.leds_on();
+        wait(0.1);
+        pad.leds_off();
+        wait(0.1);
+    }
  
 }