Ahmed Adamjee
/
SnakeVSBlock
Snake vs Block Game to be run upon K64F.
Diff: MenuClasses/StartScreen/StartScreen.cpp
- Revision:
- 58:affb42c56cf8
- Parent:
- 57:845781aea5ec
- Child:
- 59:c65a2e933c47
--- a/MenuClasses/StartScreen/StartScreen.cpp Sun Apr 28 18:17:48 2019 +0000 +++ b/MenuClasses/StartScreen/StartScreen.cpp Sun Apr 28 19:40:50 2019 +0000 @@ -133,7 +133,7 @@ StartScreen::~StartScreen() { - + } void StartScreen::init() @@ -273,8 +273,10 @@ back_pressed = 1; break; } - else {back_pressed = 0;} + else {back_pressed = 0;} } + pad.tone(1000.0,0.1); + if (g_mode == 2) { StartScreen::motionControlInstructions(lcd); } if(back_pressed) { main_menu(lcd, pad); } @@ -318,14 +320,26 @@ } } +void StartScreen::motionControlInstructions(N5110 &lcd) +{ + lcd.clear(); + lcd.printString("While playing the",5,0); //Function used to promt the user to start. + lcd.printString("game, press",9,1); + lcd.printString("A to centre",8,2); + lcd.printString("the snake at",9,3); + lcd.printString("prefered angle",0,4); + lcd.refresh(); + wait(2); +} + void StartScreen::game_speed(N5110 &lcd, Gamepad &pad) { lcd.clear(); wait(2/cs); pad.init(); while ((pad.check_event(Gamepad::A_PRESSED) == false)&&(pad.check_event(Gamepad::START_PRESSED) == false)) { //Change this to if button pressed. - StartScreen::ImplementGS(pad); - StartScreen::DisplayGSContents(lcd); + StartScreen::selectSpeedPage(pad); + StartScreen::showSpeedOptions(lcd); if (pad.check_event(Gamepad::BACK_PRESSED) == true) { //This is a very important process, this helps the code to not get stuck in menu loop. pad.tone(1000.0,0.1); back_pressed = 1; @@ -343,7 +357,7 @@ } } -void StartScreen::ImplementGS(Gamepad &pad) +void StartScreen::selectSpeedPage(Gamepad &pad) { Direction d = pad.get_direction(); wait(1/cs); @@ -361,7 +375,7 @@ } } -void StartScreen::DisplayGSContents(N5110 &lcd) +void StartScreen::showSpeedOptions(N5110 &lcd) { lcd.clear(); lcd.drawSprite(10,22,13,8,(int *)navL); //Function used to draw the sprite.