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:
- 2:00a3edbe39b0
- Parent:
- 1:f09ff0ed98fd
- Child:
- 3:53f0365461c0
--- a/main.cpp Wed May 08 19:44:17 2019 +0000 +++ b/main.cpp Wed May 08 20:01:46 2019 +0000 @@ -17,7 +17,7 @@ #define WALL_GAP 8 #define AVENGER_SIZE 2 #define STONE_SIZE 1 -#define SPEED 3 +#define SPEED 2 /////////////// structs ///////////////// struct UserInput { @@ -38,19 +38,23 @@ ///////////// functions //////////////// int main() { - int fps = 8; + int fps = 10; + int avenger_score = _avenger.get_score(); init(); // initialise and then display welcome screen... welcome(); render(); wait(1.0f/fps); // and wait for one frame period - while (1) { + while (avenger_score >= 0) { + eng.read_input(pad); eng.update(pad); + render(); wait(1.0f/fps); } + endgame(); } void init() { @@ -79,4 +83,14 @@ lcd.clear(); eng.draw(lcd); lcd.refresh(); +} + +void endgame() { + + while ( pad.check_event(Gamepad::START_PRESSED) == false) { + lcd.clear(); + lcd.printString("Eternity Stone",0,1); + lcd.refresh(); + wait(0.1); + } } \ No newline at end of file