![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
contains my game for the embedded systems project 2645
Dependencies: mbed FXOS8700CQQQ
Diff: GameMenus/Menus.cpp
- Revision:
- 40:13b8467526d0
- Parent:
- 33:24ef796ff2c8
diff -r 822b66b1c935 -r 13b8467526d0 GameMenus/Menus.cpp --- a/GameMenus/Menus.cpp Fri May 03 16:57:52 2019 +0000 +++ b/GameMenus/Menus.cpp Tue May 07 15:17:21 2019 +0000 @@ -53,8 +53,8 @@ void Menus::check_button_pressed(Gamepad &pad,N5110 &lcd){ if (pad.check_event(Gamepad::A_PRESSED) == true){//if A presed pad.leds_off(); - while(1){//call the game loop - Rocket_Race.Game_Loop(lcd,pad); + while(pad.check_event(Gamepad::BACK_PRESSED) == false){//loop since back not pressed + Rocket_Race.Game_Loop(lcd,pad);//call the game loop } }else if (pad.check_event(Gamepad::B_PRESSED) == true){//if B presed InstructionsMenu(pad,lcd);//call the instructions menu @@ -63,8 +63,8 @@ } }else if (pad.check_event(Gamepad::Y_PRESSED) == true){//if Y presed pad.leds_off(); - while(1){//call the game loop with accelerometer control - Rocket_Race.Game_Loop_accelerometer(lcd,pad); + while(pad.check_event(Gamepad::BACK_PRESSED) == false){//loop since back not pressed + Rocket_Race.Game_Loop_accelerometer(lcd,pad);//call the game loop with accelerometer control } }else if (pad.check_event(Gamepad::X_PRESSED) == true){//if X presed credits(lcd,pad);//call the credits page @@ -125,6 +125,7 @@ lcd.printString("accelormeter",0,1); lcd.printString("to control ",0,2); lcd.printString("the rocket ",0,3); + lcd.printString("in play/acc",0,4); lcd.printString("< press BACK ", 12, 5); lcd.refresh();