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:
19:8400ecdb69e9
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 13:94abfe83a294 1 #ifndef CONTROLS_H
Kern_EL17KJTF 13:94abfe83a294 2 #define CONTROLS_H
Kern_EL17KJTF 13:94abfe83a294 3
Kern_EL17KJTF 13:94abfe83a294 4 #include "mbed.h"
Kern_EL17KJTF 13:94abfe83a294 5 #include "N5110.h"
Kern_EL17KJTF 13:94abfe83a294 6 #include "Gamepad.h"
Kern_EL17KJTF 13:94abfe83a294 7
Kern_EL17KJTF 19:8400ecdb69e9 8 /** Controls Class
Kern_EL17KJTF 19:8400ecdb69e9 9 *@brief This class is for the controls menu screen
Kern_EL17KJTF 19:8400ecdb69e9 10 *@author Kern Fowler
Kern_EL17KJTF 19:8400ecdb69e9 11 *@version 1.0
Kern_EL17KJTF 19:8400ecdb69e9 12 *@date May 2019
Kern_EL17KJTF 19:8400ecdb69e9 13 */
Kern_EL17KJTF 13:94abfe83a294 14
Kern_EL17KJTF 19:8400ecdb69e9 15 class Controls {
Kern_EL17KJTF 13:94abfe83a294 16
Kern_EL17KJTF 19:8400ecdb69e9 17 public:
Kern_EL17KJTF 19:8400ecdb69e9 18 /** Controls Constructor
Kern_EL17KJTF 19:8400ecdb69e9 19 @brief Builds my default Controls contructor.
Kern_EL17KJTF 19:8400ecdb69e9 20 @details This does not have any setup.
Kern_EL17KJTF 19:8400ecdb69e9 21 */
Kern_EL17KJTF 19:8400ecdb69e9 22 Controls();
Kern_EL17KJTF 19:8400ecdb69e9 23 /** Controls Destructor
Kern_EL17KJTF 19:8400ecdb69e9 24 @brief Builds my default Controls Destructor.
Kern_EL17KJTF 19:8400ecdb69e9 25 @details This does not have any setup.
Kern_EL17KJTF 19:8400ecdb69e9 26 */
Kern_EL17KJTF 19:8400ecdb69e9 27 ~Controls();
Kern_EL17KJTF 19:8400ecdb69e9 28 // Mutators
Kern_EL17KJTF 13:94abfe83a294 29
Kern_EL17KJTF 19:8400ecdb69e9 30 /**
Kern_EL17KJTF 19:8400ecdb69e9 31 *@brief Prints the Controls menu.
Kern_EL17KJTF 19:8400ecdb69e9 32 *@param pad The Gamepad class is used.
Kern_EL17KJTF 19:8400ecdb69e9 33 *@param lcd The N5110 class is used.
Kern_EL17KJTF 19:8400ecdb69e9 34 *@details Prints various text to screen relating to the game controls.
Kern_EL17KJTF 33:3894a7f846a0 35 *@code
Kern_EL17KJTF 33:3894a7f846a0 36 void Controls::controls_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("Control State");
Kern_EL17KJTF 33:3894a7f846a0 40 lcd.clear();
Kern_EL17KJTF 33:3894a7f846a0 41 lcd.printString("Controls",19,0);
Kern_EL17KJTF 33:3894a7f846a0 42 lcd.printString("Move Joystick ",0,2);
Kern_EL17KJTF 33:3894a7f846a0 43 lcd.printString("Left or Right ",0,3);
Kern_EL17KJTF 33:3894a7f846a0 44 lcd.printString(" to move ",0,4);
Kern_EL17KJTF 33:3894a7f846a0 45 lcd.printString(" Donkey Kong ",0,5);
Kern_EL17KJTF 33:3894a7f846a0 46 lcd.refresh();
Kern_EL17KJTF 33:3894a7f846a0 47 wait_ms(1.0f/24);
Kern_EL17KJTF 33:3894a7f846a0 48 }
Kern_EL17KJTF 33:3894a7f846a0 49 }
Kern_EL17KJTF 33:3894a7f846a0 50 @endcode
Kern_EL17KJTF 19:8400ecdb69e9 51 */
Kern_EL17KJTF 19:8400ecdb69e9 52 void controls_run(Gamepad &pad, N5110 &lcd);
Kern_EL17KJTF 13:94abfe83a294 53 };
Kern_EL17KJTF 13:94abfe83a294 54
Kern_EL17KJTF 19:8400ecdb69e9 55 #endif