Kern Fowler / Mbed 2 deprecated Donkey_Kong_Game

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Instructions.h Source File

Instructions.h

00001 #ifndef INSTRUCTIONS_H
00002 #define INSTRUCTIONS_H
00003 
00004 #include "mbed.h"
00005 #include "N5110.h"
00006 #include "Gamepad.h"
00007 
00008 /** Instructions Class
00009 *@brief This class is for the instructions menu screen.
00010 *@author Kern Fowler
00011 *@version 1.0
00012 *@date May 2019
00013 */
00014 
00015 class Instructions {
00016 
00017 public:
00018 /** Instructions Constructor 
00019 @brief Builds my default Instructions contructor.
00020 @details This does not have any setup. 
00021 */
00022 Instructions();
00023 /** Instructions Destructor 
00024 @brief Builds my default Instructions destructor.
00025 @details This does not have any setup. 
00026 */
00027 ~Instructions();
00028 // Mutators
00029 
00030 /** 
00031 *@brief Prints the Instructions menu.
00032 *@param pad The Gamepad class is used.
00033 *@param lcd The N5110 class is used.
00034 *@return None.
00035 *@details Prints various text to screen relating to how to play the game.
00036 *@code
00037 void Instructions::instructions_run(Gamepad &pad, N5110 &lcd) {
00038     wait_ms(250);
00039     while (pad.check_event(Gamepad::BACK_PRESSED) == false) { // Continues to show this screen until BACK button pressed.
00040         //printf("Instructions State");
00041         lcd.clear();
00042         lcd.printString("Instructions",7,0);
00043         lcd.printString("Move DonkeyKong",0,2);
00044         lcd.printString("left or right",0,3);
00045         lcd.printString("to collect ",0,4);
00046         lcd.printString("Bananas",0,5);
00047         lcd.refresh();
00048         wait(4); // Changes to next screen after 4 seconds.
00049         lcd.clear();
00050         lcd.printString("Instructions",7,0);
00051         lcd.printString("Avoid the ",0,2);
00052         lcd.printString("falling ",0,3);
00053         lcd.printString("Barrels ",0,4);
00054         lcd.refresh();
00055         wait(4); // Loops through both screens. 
00056     }
00057 }
00058 @endcode
00059 */
00060 void instructions_run(Gamepad &pad, N5110 &lcd);
00061 };
00062 
00063 #endif