Kern Fowler / Mbed 2 deprecated Donkey_Kong_Game

Dependencies:   mbed

Committer:
Kern_EL17KJTF
Date:
Thu May 09 10:46:03 2019 +0000
Revision:
33:3894a7f846a0
Parent:
14:d6fbbb912425
Child:
39:1d0584a152a6
Mbed update at revision 20 caused an issue when running on board. Downgraded the mbed and now works.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kern_EL17KJTF 14:d6fbbb912425 1 #ifndef INSTRUCTIONS_H
Kern_EL17KJTF 14:d6fbbb912425 2 #define INSTRUCTIONS_H
Kern_EL17KJTF 14:d6fbbb912425 3
Kern_EL17KJTF 14:d6fbbb912425 4 #include "mbed.h"
Kern_EL17KJTF 14:d6fbbb912425 5 #include "N5110.h"
Kern_EL17KJTF 14:d6fbbb912425 6 #include "Gamepad.h"
Kern_EL17KJTF 14:d6fbbb912425 7
Kern_EL17KJTF 33:3894a7f846a0 8 /** Instructions Class
Kern_EL17KJTF 33:3894a7f846a0 9 *@brief This class is for the instructions menu screen.
Kern_EL17KJTF 33:3894a7f846a0 10 *@author Kern Fowler
Kern_EL17KJTF 33:3894a7f846a0 11 *@version 1.0
Kern_EL17KJTF 33:3894a7f846a0 12 *@date May 2019
Kern_EL17KJTF 33:3894a7f846a0 13 */
Kern_EL17KJTF 33:3894a7f846a0 14
Kern_EL17KJTF 33:3894a7f846a0 15 class Instructions {
Kern_EL17KJTF 14:d6fbbb912425 16
Kern_EL17KJTF 33:3894a7f846a0 17 public:
Kern_EL17KJTF 33:3894a7f846a0 18 /** Instructions Constructor
Kern_EL17KJTF 33:3894a7f846a0 19 @brief Builds my default Instructions contructor.
Kern_EL17KJTF 33:3894a7f846a0 20 @details This does not have any setup.
Kern_EL17KJTF 33:3894a7f846a0 21 */
Kern_EL17KJTF 33:3894a7f846a0 22 Instructions();
Kern_EL17KJTF 33:3894a7f846a0 23 /** Instructions Destructor
Kern_EL17KJTF 33:3894a7f846a0 24 @brief Builds my default Instructions destructor.
Kern_EL17KJTF 33:3894a7f846a0 25 @details This does not have any setup.
Kern_EL17KJTF 33:3894a7f846a0 26 */
Kern_EL17KJTF 33:3894a7f846a0 27 ~Instructions();
Kern_EL17KJTF 33:3894a7f846a0 28 // Mutators
Kern_EL17KJTF 14:d6fbbb912425 29
Kern_EL17KJTF 33:3894a7f846a0 30 /**
Kern_EL17KJTF 33:3894a7f846a0 31 *@brief Prints the Instructions menu.
Kern_EL17KJTF 33:3894a7f846a0 32 *@param pad The Gamepad class is used.
Kern_EL17KJTF 33:3894a7f846a0 33 *@param lcd The N5110 class is used.
Kern_EL17KJTF 33:3894a7f846a0 34 *@details Prints various text to screen relating to how to play the game.
Kern_EL17KJTF 33:3894a7f846a0 35 *@code
Kern_EL17KJTF 33:3894a7f846a0 36 void Instructions::instructions_run(Gamepad &pad, N5110 &lcd) {
Kern_EL17KJTF 33:3894a7f846a0 37 wait_ms(250);
Kern_EL17KJTF 33:3894a7f846a0 38 while (pad.check_event(Gamepad::BACK_PRESSED) == false) { // Continues to show this screen until BACK button pressed.
Kern_EL17KJTF 33:3894a7f846a0 39 //printf("Instructions State");
Kern_EL17KJTF 33:3894a7f846a0 40 lcd.clear();
Kern_EL17KJTF 33:3894a7f846a0 41 lcd.printString("Instructions",7,0);
Kern_EL17KJTF 33:3894a7f846a0 42 lcd.printString("Move DonkeyKong",0,2);
Kern_EL17KJTF 33:3894a7f846a0 43 lcd.printString("left or right",0,3);
Kern_EL17KJTF 33:3894a7f846a0 44 lcd.printString("to collect ",0,4);
Kern_EL17KJTF 33:3894a7f846a0 45 lcd.printString("Bananas",0,5);
Kern_EL17KJTF 33:3894a7f846a0 46 lcd.refresh();
Kern_EL17KJTF 33:3894a7f846a0 47 wait(4); // Changes to next screen after 4 seconds.
Kern_EL17KJTF 33:3894a7f846a0 48 lcd.clear();
Kern_EL17KJTF 33:3894a7f846a0 49 lcd.printString("Instructions",7,0);
Kern_EL17KJTF 33:3894a7f846a0 50 lcd.printString("Avoid the ",0,2);
Kern_EL17KJTF 33:3894a7f846a0 51 lcd.printString("falling ",0,3);
Kern_EL17KJTF 33:3894a7f846a0 52 lcd.printString("Barrels ",0,4);
Kern_EL17KJTF 33:3894a7f846a0 53 lcd.refresh();
Kern_EL17KJTF 33:3894a7f846a0 54 wait(4); // Loops through both screens.
Kern_EL17KJTF 33:3894a7f846a0 55 }
Kern_EL17KJTF 33:3894a7f846a0 56 }
Kern_EL17KJTF 33:3894a7f846a0 57 @endcode
Kern_EL17KJTF 33:3894a7f846a0 58 */
Kern_EL17KJTF 33:3894a7f846a0 59 void instructions_run(Gamepad &pad, N5110 &lcd);
Kern_EL17KJTF 14:d6fbbb912425 60 };
Kern_EL17KJTF 14:d6fbbb912425 61
Kern_EL17KJTF 33:3894a7f846a0 62 #endif