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:
- 12:ab3f5fcc8d3b
- Parent:
- 11:ba1906f151fd
- Child:
- 20:7c6ef9b0c78a
--- a/main.cpp Mon Apr 29 23:57:59 2019 +0000
+++ b/main.cpp Mon May 06 15:34:26 2019 +0000
@@ -46,7 +46,6 @@
void update_game(UserInput input);
void render();
void welcome();
-void menu();
@@ -58,13 +57,12 @@
int fps = 8; // frames per second
init(); // initialise and then display welcome screen...
- welcome();
- menu(); // waiting for the user to start
+ welcome(); // waiting for the user to start
render(); // first draw the initial frame
wait(1.0f/fps); // and wait for one frame period
// game loop - read input, update the game state and render the display
- while (1) {
+ while (1) {
lcd.clear();
@@ -91,17 +89,8 @@
}
init();
- wait(1.0);
- //menu();
- lcd.clear();
- if ( pad.check_event(Gamepad::START_PRESSED) == true){
- lcd.clear();
welcome();
- lcd.refresh();
- } else if (pad.check_event(Gamepad::START_PRESSED) == false){
- lcd.clear();
- menu();
- }
+
render();
wait(1.0f/fps);
}
@@ -263,42 +252,5 @@
}
-void menu() {
- pad.leds_on();
- lcd.printString("_LEVEL1 A_ ",8,3);
- lcd.printString("_LEVEL2 B_ ",8,5);
- lcd.refresh();
- while ( pad.check_event(Gamepad::A_PRESSED) == false) {
- pad.leds_on();
- wait(0.2);
- pad.tone(50,0.1);
- wait(0.2);
- pad.tone(100,0.01);
- wait(0.2);
- pad.tone(500,0.1);
- wait(0.2);
- pad.tone(700,0.01);
- wait(0.2);
- pad.tone(500,0.1);
- wait(0.2);
- pad.tone(100,0.01);
- wait(0.2);
- pad.tone(50,0.1);
- wait(0.2);
- pad.tone(100,0.01);
- wait(0.2);
- pad.tone(500,0.1);
- wait(0.2);
- pad.tone(700,0.1);
- wait(0.2);
- pad.tone(500,0.1);
- wait(0.2);
- pad.tone(100,0.1);
- wait(0.2);
- pad.tone(50,0.1);
- }
- lcd.refresh();
- }
-
-
\ No newline at end of file
+
\ No newline at end of file