Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Diff: main.cpp
- Revision:
- 9:436b88b70fdd
- Parent:
- 8:3c15554e6723
- Child:
- 10:2b52d7e06712
--- 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);
+ }
}