This is the Mexican Standoff prototype made by Francisco Martin and Andrew Smith. Please refer to the following link for instructions on hardware hookup: https://developer.mbed.org/users/fomartin/notebook/mexican-standoff-reaction-game/
Dependencies: SDFileSystem mbed-rtos mbed wave_player 4DGL-uLCD-SE PinDetect
Diff: States/Rules.cpp
- Revision:
- 1:4976bbb3376f
- Parent:
- 0:75716bd37804
--- a/States/Rules.cpp Mon Mar 14 03:04:08 2016 +0000 +++ b/States/Rules.cpp Mon Mar 14 16:19:47 2016 +0000 @@ -1,6 +1,11 @@ #include "States.h" #include <algorithm> + +/** + * Displays the rules of the game to the player. The right buttons are used to scroll between instruction pages. + * Either of the left buttons will return back to the Startup screen. + */ Rules::Rules(uLCD_4DGL &uLCD, PinDetect &button0, PinDetect &button1, PinDetect &button2, PinDetect &button3) { uLCD.color(LGREY); @@ -50,6 +55,7 @@ } } + //check to see if user has pressed button to scroll to next page if(!button3) { if(page != 0) @@ -62,7 +68,7 @@ if(page != 2) updateText = true; - page = min(2, page + 1); + page = min(1, page + 1); } } while(button0 && button1); //evaluate this after rendering text so it doesn't immediately exit menu if button is down