Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 15:1564bd6b713d
- Parent:
- 14:108052b6222b
- Child:
- 16:e846864778c4
--- a/main.cpp Sun Apr 14 16:40:51 2019 +0000 +++ b/main.cpp Mon Apr 15 07:29:35 2019 +0000 @@ -26,14 +26,14 @@ void startscreen(); int menu(); void init(); - +void print_start_menu(int output); ////////////////Main Function////////////// int main(){ - int fps = 12; + int fps = 30; init(); startscreen(); int choice_selected = menu(); @@ -65,7 +65,7 @@ lcd.printChar(gamename[i], 15+i*6, 2); lcd.refresh(); } - wait_ms(50); + wait_ms(50); } lcd.printString("Press start", 9, 4); lcd.printString("to play >", 15, 5); @@ -82,7 +82,7 @@ } int menu(){ - GameEngine::StartSelection fsm[3] = { + StartSelection fsm[3] = { {0,{OPTIONS,BRICKBREAKER,CLASSIC}}, {2,{CLASSIC,OPTIONS,BRICKBREAKER}}, {4,{BRICKBREAKER,CLASSIC,OPTIONS}} @@ -95,16 +95,19 @@ if(gamepad.get_direction() == N){ next = 0;} else if(gamepad.get_direction() == S){ next = 1;} else {next = 2;} - - lcd.printString(">", 0, fsm[state].output); - lcd.printString("Classic", 36, 0); - lcd.printString("BrickBreak", 18, 2); - lcd.printString("Options", 36, 4); - lcd.printString("(Joy R>>)", 30, 5); + print_start_menu(fsm[state].output); lcd.refresh(); wait(0.25); } lcd.clear(); lcd.refresh(); return state; +} + +void print_start_menu(int output){ + lcd.printString(">", 0, output); + lcd.printString("Classic", 36, 0); + lcd.printString("BrickBreak", 18, 2); + lcd.printString("Options", 36, 4); + lcd.printString("(Joy R>>)", 30, 5); } \ No newline at end of file