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:
- 64:b373b6bf8255
- Parent:
- 63:ec95e155fb30
- Child:
- 66:c4ba64d288ba
--- a/main.cpp Thu May 09 11:04:28 2019 +0000
+++ b/main.cpp Thu May 09 11:45:21 2019 +0000
@@ -62,11 +62,11 @@
*/
void restart();
/** Displays options screen
- * @details gives player controls and displays credits
+ * @details gives player controls for game
*/
void option_screen();
-bool options = false;
+bool options_flag = false;
///////////// functions ////////////////
@@ -125,7 +125,7 @@
// displays start screen and waits for user to press start
void start_screen()
{
- while (pad.check_event(Gamepad::START_PRESSED) == false && options == false) {
+ while (pad.check_event(Gamepad::START_PRESSED) == false && options_flag == false) {
lcd.clear();
lcd.drawSprite(2,20,8,3,(int *)miner_right);
lcd.drawSprite(79,20,8,3,(int *)miner_left);
@@ -134,17 +134,17 @@
lcd.printString("Press start!",8,2);
lcd.printString("A = Controls",6,4);
contrast();
- //printf("start screen = %d \n",options);
+ //printf("start screen = %d \n",options_flag);
if (pad.check_event(Gamepad::A_PRESSED) == true) {
- options = true;
- //printf("options = %d \n",options);
+ options_flag = true;
+ //printf("options = %d \n",options_flag);
}
}
}
// displays options screen
void option_screen()
{
- while (options == true) {
+ while (options_flag == true) {
lcd.clear();
lcd.printString("Stick = L/R",0,0);
lcd.printString("A = Jump ",0,1);
@@ -155,7 +155,7 @@
//printf("options screen = %d \n",options);
lcd.refresh();
if (pad.check_event(Gamepad::BACK_PRESSED) == true) {
- options = false;
+ options_flag = false;
start_screen();
}
}