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: lib/Instructions/Instructions.h
- Revision:
- 33:3894a7f846a0
- Parent:
- 14:d6fbbb912425
- Child:
- 39:1d0584a152a6
--- a/lib/Instructions/Instructions.h Wed May 08 23:46:49 2019 +0000 +++ b/lib/Instructions/Instructions.h Thu May 09 10:46:03 2019 +0000 @@ -1,9 +1,3 @@ -/* -ELEC2645 Project -Instructions.h -Class file for Instructions in Donkey Kong game. -*/ - #ifndef INSTRUCTIONS_H #define INSTRUCTIONS_H @@ -11,17 +5,58 @@ #include "N5110.h" #include "Gamepad.h" -class Instructions -{ +/** Instructions Class +*@brief This class is for the instructions menu screen. +*@author Kern Fowler +*@version 1.0 +*@date May 2019 +*/ + +class Instructions { - public: +public: +/** Instructions Constructor +@brief Builds my default Instructions contructor. +@details This does not have any setup. +*/ +Instructions(); +/** Instructions Destructor +@brief Builds my default Instructions destructor. +@details This does not have any setup. +*/ +~Instructions(); +// Mutators - Instructions(); - - ~Instructions(); - - void instructions_run(Gamepad &pad, N5110 &lcd); - +/** +*@brief Prints the Instructions menu. +*@param pad The Gamepad class is used. +*@param lcd The N5110 class is used. +*@details Prints various text to screen relating to how to play the game. +*@code +void Instructions::instructions_run(Gamepad &pad, N5110 &lcd) { + wait_ms(250); + while (pad.check_event(Gamepad::BACK_PRESSED) == false) { // Continues to show this screen until BACK button pressed. + //printf("Instructions State"); + lcd.clear(); + lcd.printString("Instructions",7,0); + lcd.printString("Move DonkeyKong",0,2); + lcd.printString("left or right",0,3); + lcd.printString("to collect ",0,4); + lcd.printString("Bananas",0,5); + lcd.refresh(); + wait(4); // Changes to next screen after 4 seconds. + lcd.clear(); + lcd.printString("Instructions",7,0); + lcd.printString("Avoid the ",0,2); + lcd.printString("falling ",0,3); + lcd.printString("Barrels ",0,4); + lcd.refresh(); + wait(4); // Loops through both screens. + } +} +@endcode +*/ +void instructions_run(Gamepad &pad, N5110 &lcd); }; -#endif +#endif \ No newline at end of file