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
Fork of el17dg by
Diff: game/game.cpp
- Revision:
- 24:0570cb4b92d7
- Parent:
- 23:240bc00ef25b
- Child:
- 26:676874c42883
--- a/game/game.cpp Sun Mar 31 01:04:59 2019 +0000
+++ b/game/game.cpp Tue Apr 02 15:38:40 2019 +0000
@@ -150,6 +150,9 @@
lcd.refresh();
wait(0.1);
}
+ char buffer[4];
+ sprintf(buffer,"Your Score %i",game_score);
+ lcd.printString(buffer,0,3);
wait(1);
lcd.printString("Press Y",0,4);
lcd.printString("to restart",0,5);
@@ -206,12 +209,17 @@
lcd.drawSpriteOnTop(player.pos.x, player.pos.y, spaceship1_width, spaceship1_height, (int *)spaceShip1);
+
+ /**@brief
+ * This small statment checks whether the pause button was pressed or not.
+ * If it was pressed, then the game will go back to main menu and will save
+ * the current status of the object until the game is continued.
+ */
bool want_to_pause = false;
if (game_over){
gameOver();
want_to_pause = true;
}
-
if (gamepad.check_event(gamepad.START_PRESSED)){
want_to_pause = true;
