Mochu Yao explorer game
Dependencies: mbed
Diff: menu/Menu.cpp
- Revision:
- 30:65e639ace415
- Parent:
- 22:f8ba0ab7465c
- Child:
- 31:8e92b65e0779
diff -r 2d592452e3fb -r 65e639ace415 menu/Menu.cpp --- a/menu/Menu.cpp Tue Apr 28 18:26:20 2020 +0000 +++ b/menu/Menu.cpp Wed Apr 29 03:18:13 2020 +0000 @@ -31,9 +31,9 @@ //there are three pages so we have three output and we cna press the start, back and y button to change the page.These are the input // State fsm[3] = { - {0,{0,2,0,0}}, - {1,{2,2,0,1}}, - {2,{1,2,1,0}} + {0,0.5,{0,2,0,0}}, + {1,0.5,{2,2,0,1}}, + {2,0.5,{1,2,1,0}} }; Menu::Menu() {} @@ -49,7 +49,8 @@ get_input(gamepad.check_event(Gamepad::START_PRESSED), gamepad.check_event(Gamepad::BACK_PRESSED), gamepad.check_event(Gamepad::B_PRESSED)); - _output = fsm[_state].output; + _output = fsm[_state].output; + wait(fsm[_state].time); // implement required delay // set the next state depending on direction _state = fsm[_state].next_state[_input_value];