Ahmed Adamjee
/
SnakeVSBlock
Snake vs Block Game to be run upon K64F.
Diff: GameEngine/WinLoose/WinLoose.cpp
- Revision:
- 63:205f0ca48473
- Parent:
- 62:ebf6ecf8a6d5
- Child:
- 83:329da564799a
diff -r ebf6ecf8a6d5 -r 205f0ca48473 GameEngine/WinLoose/WinLoose.cpp --- a/GameEngine/WinLoose/WinLoose.cpp Tue Apr 30 14:53:38 2019 +0000 +++ b/GameEngine/WinLoose/WinLoose.cpp Wed May 01 22:35:40 2019 +0000 @@ -18,8 +18,8 @@ lcd.printString("Press Start",10,3); lcd.printString("to Proceed",12,4); lcd.refresh(); - wait(0.05); - while (pad.check_event(Gamepad::START_PRESSED) == false) { + wait(0.05); //to avoid race condition of skipping the following while loop. + while ((pad.check_event(Gamepad::START_PRESSED) == false)&&(pad.check_event(Gamepad::A_PRESSED) == false)) { pad.leds_on(); pad.tone(rand()%1001,0.1); //helps to set max freq for random sound wait(0.1); @@ -39,7 +39,7 @@ lcd.refresh(); wait(2); } - + void WinLoose::GameOver(N5110 &lcd, Gamepad &pad) { //pad.init();