![](/media/cache/profiles/LinkedIn_0NghoZJ.jpeg.50x50_q85.jpg)
Snake vs Block Game to be run upon K64F.
Diff: StartScreen/StartScreen.cpp
- Revision:
- 33:249cf423fb18
- Parent:
- 32:3a3bdeffdf62
- Child:
- 34:89f53ffc81bb
--- a/StartScreen/StartScreen.cpp Mon Apr 15 13:58:09 2019 +0000 +++ b/StartScreen/StartScreen.cpp Wed Apr 17 07:47:06 2019 +0000 @@ -181,7 +181,7 @@ lcd.clear(); } -void StartScreen::menu_screen1(N5110 &lcd, Gamepad &pad) +void StartScreen::main_menu(N5110 &lcd, Gamepad &pad, SDFileSystem &sd) { lcd.clear(); StartScreen::init(); @@ -191,22 +191,24 @@ } pad.tone(1000.0,0.1); wait(1/cs); - if(i == 16) - { - menu_screen2(lcd, pad); + if(i == 16) { + game_mode(lcd, pad, sd); } - else if(i == 24) - { + else if(i == 24) { float *cs_sc; cs_sc = settings.Implement(lcd, pad, st, cs); pad.tone(1000.0,0.1); - menu_screen1(lcd, pad); cs = cs_sc[0]; sc = cs_sc[1]; -} - else - { - menu_screen1(lcd, pad); + main_menu(lcd, pad, sd); + } + else if(i == 32) { + _stats.StatsDisplay(lcd, pad, sd); + pad.tone(1000.0,0.1); + main_menu(lcd, pad, sd); + } + else { + main_menu(lcd, pad, sd); lr=1; } } @@ -231,7 +233,7 @@ lcd.clear(); } -void StartScreen::menu_screen2(N5110 &lcd, Gamepad &pad) +void StartScreen::game_mode(N5110 &lcd, Gamepad &pad, SDFileSystem &sd) { lcd.clear(); wait(2/cs); @@ -261,15 +263,16 @@ } if (pad.check_event(Gamepad::BACK_PRESSED) == true) { pad.tone(1000.0,0.1); - menu_screen1(lcd, pad); + main_menu(lcd, pad, sd); } lcd.refresh(); } + gs = 1; pad.tone(1000.0,0.1); lcd.clear(); - menu_screen3(lcd, pad); + game_speed(lcd, pad, sd); } -void StartScreen::menu_screen3(N5110 &lcd, Gamepad &pad) +void StartScreen::game_speed(N5110 &lcd, Gamepad &pad, SDFileSystem &sd) { lcd.clear(); wait(2/cs); @@ -313,7 +316,7 @@ if (pad.check_event(Gamepad::BACK_PRESSED) == true) { pad.tone(1000.0,0.1); - menu_screen2(lcd, pad); + game_mode(lcd, pad, sd); } lcd.refresh(); }