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: Game/Game.cpp
- Revision:
- 3:c61d0c70eda4
- Parent:
- 2:7fa08670b1fc
- Child:
- 4:17d5b53b8815
--- a/Game/Game.cpp Tue May 26 16:26:12 2020 +0000 +++ b/Game/Game.cpp Tue May 26 16:52:17 2020 +0000 @@ -79,16 +79,16 @@ } } -bool Game::death(N5110 &lcd,Gamepad &pad) +int Game::death(N5110 &lcd,Gamepad &pad) { if (x < 1 || x > WIDTH-2) { //if you hit the side walls you die while (1) { gameover(lcd, pad); if (pad.B_held()) { - return true; + return 2; } if (pad.start_held()) { - return false; + return 1; } } } @@ -97,10 +97,10 @@ while (1) { gameover(lcd, pad); if (pad.B_held()) { - return true; + return 2; } if (pad.start_held()) { - return false; + return 1; } } } @@ -109,15 +109,15 @@ while (1) { gameover(lcd, pad); if (pad.B_held()) { - return true; + return 2; } if (pad.start_held()) { - return false; + return 1; } } } } - return false; + return 0; } void Game::draw(N5110 &lcd,Gamepad &pad)