Kern Fowler / Mbed 2 deprecated Donkey_Kong_Game

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Controls Class Reference

Controls Class Reference

Controls Class. More...

#include <Controls.h>

Public Member Functions

 Controls ()
 Controls Constructor.
 ~Controls ()
 Controls Destructor.
void controls_run (Gamepad &pad, N5110 &lcd)
 Prints the Controls menu.

Detailed Description

Controls Class.

This class is for the controls menu screen

Author:
Kern Fowler
Version:
1.0
Date:
May 2019

Definition at line 15 of file Controls.h.


Constructor & Destructor Documentation

Controls (  )

Controls Constructor.

Builds my default Controls contructor.

This does not have any setup.

Definition at line 10 of file Controls.cpp.

~Controls (  )

Controls Destructor.

Builds my default Controls Destructor.

This does not have any setup.

Definition at line 16 of file Controls.cpp.


Member Function Documentation

void controls_run ( Gamepad pad,
N5110 lcd 
)

Prints the Controls menu.

Parameters:
padThe Gamepad class is used.
lcdThe N5110 class is used.
Returns:
None.

Prints various text to screen relating to the game controls.

void Controls::controls_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("Control State");
        lcd.clear();
        lcd.printString("Controls",19,0);
        lcd.printString("Move Joystick ",0,2);
        lcd.printString("Left or Right ",0,3);
        lcd.printString("   to move    ",0,4);
        lcd.printString(" Donkey Kong  ",0,5);
        lcd.refresh();
        wait_ms(1.0f/24);
    }
}

Definition at line 22 of file Controls.cpp.