Kern Fowler / Mbed 2 deprecated Donkey_Kong_Game

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Instructions Class Reference

Instructions Class Reference

Instructions Class. More...

#include <Instructions.h>

Public Member Functions

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

Detailed Description

Instructions Class.

This class is for the instructions menu screen.

Author:
Kern Fowler
Version:
1.0
Date:
May 2019

Definition at line 15 of file Instructions.h.


Constructor & Destructor Documentation

Instructions (  )

Instructions Constructor.

Builds my default Instructions contructor.

This does not have any setup.

Definition at line 10 of file Instructions.cpp.

~Instructions (  )

Instructions Destructor.

Builds my default Instructions destructor.

This does not have any setup.

Definition at line 16 of file Instructions.cpp.


Member Function Documentation

void instructions_run ( Gamepad pad,
N5110 lcd 
)

Prints the Instructions menu.

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

Prints various text to screen relating to how to play the game.

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. 
    }
}

Definition at line 22 of file Instructions.cpp.