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:
- 14:108052b6222b
- Parent:
- 13:e5a36fbd48ae
- Child:
- 15:1564bd6b713d
--- a/main.cpp Fri Apr 12 17:01:47 2019 +0000 +++ b/main.cpp Sun Apr 14 16:40:51 2019 +0000 @@ -33,7 +33,7 @@ int main(){ - int fps = 10; + int fps = 12; init(); startscreen(); int choice_selected = menu(); @@ -81,20 +81,15 @@ } } -int menu(){ - struct Selection{ - int output; - int next_state[3]; +int menu(){ + GameEngine::StartSelection fsm[3] = { + {0,{OPTIONS,BRICKBREAKER,CLASSIC}}, + {2,{CLASSIC,OPTIONS,BRICKBREAKER}}, + {4,{BRICKBREAKER,CLASSIC,OPTIONS}} }; - - Selection fsm[3] = { - {0,{2,1,0}}, - {2,{0,2,1}}, - {4,{1,0,2}} - }; - int state = 0; //start with the arrow on the top option + StartOption state = CLASSIC; //start with the arrow on the top option int next = 2; //next_state = 2 so that by default it doesn't change arrow position - while(!(gamepad.get_direction() == E)){ + while(!(gamepad.get_direction() == E)){ //select choice by pushing joystick to the right state = fsm[state].next_state[next]; lcd.clear(); if(gamepad.get_direction() == N){ next = 0;}