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.
Dependencies: mbed
Diff: Menu/Menu.cpp
- Revision:
- 26:4253656c0755
- Parent:
- 21:20478f086bc2
- Child:
- 27:c920c5ec31af
--- a/Menu/Menu.cpp Wed Apr 24 17:58:35 2019 +0000 +++ b/Menu/Menu.cpp Fri May 03 09:33:34 2019 +0000 @@ -93,6 +93,7 @@ void Menu::init() { _state = 1; // Starting state is the menu. _controller.init(); + // Initialise counters for musical tune. _tone_flag = false; _tone_counter = 0; _chord_counter = 0; @@ -122,14 +123,14 @@ void Menu::set_input(bool start, bool back, bool x) { // 0, 1, 2, 3 have been assigned to each relevent input combination. - if (!start && !back && !x) { - _menu_input = 0; // Nothing is pressed. - } else if (!start && back) { - _menu_input = 1; // Only back is pressed. - } else if (start && !back) { - _menu_input = 2; // Only start is pressed. - } else if (x) { - _menu_input = 3; // Only X is pressed. + if (!start && !back && !x) { // Nothing is pressed. + _menu_input = 0; + } else if (!start && back) { // Only back is pressed. + _menu_input = 1; + } else if (start && !back) { // Only start is pressed. + _menu_input = 2; + } else if (x) { // Only X is pressed. + _menu_input = 3; } } @@ -140,14 +141,14 @@ void Menu::display_controls(N5110 &lcd, Gamepad &gamepad) { lcd.drawLine(0,0,84,0,FILL_BLACK); lcd.drawLine(0,6,84,6,FILL_BLACK); - lcd.drawLine(0,32,84,32,FILL_BLACK); - lcd.drawLine(0,38,84,38,FILL_BLACK); + lcd.drawLine(0,24,84,24,FILL_BLACK); + lcd.drawLine(0,30,84,30,FILL_BLACK); lcd.printString("JOYSTICK:",0,0); - lcd.printString("-Move left",0,1); - lcd.printString("-Move right",0,2); - lcd.printString("-Move down",0,3); - lcd.printString("A:",0,4); - lcd.printString("-Jump (back)",0,5); + lcd.printString("-Go Left/Right",0,1); + lcd.printString("-Down to Duck",0,2); + lcd.printString("Collect Coins!",0,5); + lcd.printString("A:",0,3); + lcd.printString("-Jump",0,4); play_tone(gamepad); }