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: Enemy1 Enemy2 Enemy3 Enemy4 Enemy5 Enemy6 Engine Friendly Gamepad N5110 Rocket Stats mbed
Diff: main.cpp
- Revision:
- 4:9660fc7ede8c
- Parent:
- 3:9d0428a29f41
- Child:
- 5:638ffc5c66f6
--- a/main.cpp Thu Apr 06 09:39:43 2017 +0000
+++ b/main.cpp Sun Apr 09 12:47:07 2017 +0000
@@ -20,12 +20,14 @@
void init();
void update_game(UserInput input);
void generate();
+void welcome();
int main()
{
int fps = 14;
init();
+ welcome();
generate();
wait(1.0f/fps);
@@ -37,7 +39,7 @@
generate();
engine.death(lcd, pad);
lcd.refresh();
- wait(1.0f/fps);
+ wait(1.0f/fps);
}
}
@@ -54,4 +56,14 @@
engine.draw(lcd); // grid, health
engine.ships_gen(lcd); // ships
lcd.refresh();
+}
+
+void welcome() {
+
+ lcd.printString(" Press Start! ",0,4);
+ lcd.refresh();
+
+ while ( pad.check_event(Gamepad::START_PRESSED) == false) {
+ wait(0.1);
+ }
}
\ No newline at end of file