Ahmed Adamjee
/
SnakeVSBlock
Snake vs Block Game to be run upon K64F.
Diff: MenuClasses/StartScreen/StartScreen.cpp
- Revision:
- 61:f3c402bc2ad0
- Parent:
- 60:d3a9e0e4a0de
- Child:
- 62:ebf6ecf8a6d5
--- a/MenuClasses/StartScreen/StartScreen.cpp Mon Apr 29 14:40:42 2019 +0000 +++ b/MenuClasses/StartScreen/StartScreen.cpp Tue Apr 30 08:32:30 2019 +0000 @@ -172,7 +172,7 @@ void StartScreen::instruct(N5110 &lcd, Gamepad &pad) { - pad.init(); + //pad.init(); while ((pad.check_event(Gamepad::START_PRESSED) == false)&&(pad.check_event(Gamepad::A_PRESSED) == false)&&(Start_Pressed == 0)) { lcd.printString("Please Press",5,1); //Function used to promt the user to start. lcd.printString("Start",25,3); @@ -211,7 +211,7 @@ { lcd.clear(); //StartScreen::init(); - pad.init(); + //pad.init(); while ((pad.check_event(Gamepad::A_PRESSED) == false)&&(pad.check_event(Gamepad::START_PRESSED) == false)) { //Change this to if button pressed. StartScreen::ImplementMenu(lcd, pad); } @@ -268,7 +268,7 @@ { lcd.clear(); wait(2/cs); - pad.init(); + //pad.init(); while ((pad.check_event(Gamepad::A_PRESSED) == false)&&(pad.check_event(Gamepad::START_PRESSED) == false)) { //Change this to if button pressed. StartScreen::ModeOptions(lcd); //displays to the user what are the mode options StartScreen::SelectMode(pad); //the mode is selected by moving joystick in this function. @@ -280,9 +280,7 @@ else {back_pressed = 0;} } pad.tone(1000.0,0.1); - if(back_pressed) { - main_menu(lcd, pad); - } + if(back_pressed) { main_menu(lcd, pad); } else { if (g_mode == 2) { StartScreen::motionControlInstructions(lcd); } else { pad.tone(1000.0,0.1); } @@ -340,7 +338,7 @@ { lcd.clear(); wait(2/cs); - pad.init(); + //pad.init(); while ((pad.check_event(Gamepad::A_PRESSED) == false)&&(pad.check_event(Gamepad::START_PRESSED) == false)) { //Change this to if button pressed. StartScreen::selectSpeedPage(pad); StartScreen::showSpeedOptions(lcd); @@ -351,9 +349,7 @@ } else {back_pressed = 0;} } - if(back_pressed) { - game_mode(lcd, pad); - } + if(back_pressed) { game_mode(lcd, pad); } else { pad.tone(1000.0,0.1); lcd.clear(); @@ -379,7 +375,7 @@ } } -void StartScreen::showSpeedOptions(N5110 &lcd) +void StartScreen::showSpeedOptions(N5110 &lcd) //decrease code size. { lcd.clear(); lcd.drawSprite(10,22,13,8,(int *)navL); //Function used to draw the sprite.