Yufan Zhong / Mbed 2 deprecated GOLD_MINER

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

MinerEngine Class Reference

MinerEngine Class Reference

MinerEngine Class. More...

#include <MinerEngine.h>

Public Member Functions

 MinerEngine ()
 Constructor.
 ~MinerEngine ()
 Destructor.
void init (int winch_width, int winch_height, int gold_num, int monster_speed)
 Initialise the components of the MinerEngine.
void init_unchanged_parameter ()
 Initialise the unchanged parameter.
void state_switch (Gamepad &pad, N5110 &lcd)
 Switch the states.
int get_select (Gamepad &pad)
 Get the select.
void instruction (Gamepad &pad, N5110 &lcd)
 Print the instruction.
void menu (Gamepad &pad, N5110 &lcd)
 Print the menu.
void options (Gamepad &pad, N5110 &lcd)
 Select the difficulties.
void game_run (Gamepad &pad, N5110 &lcd)
 Run the game.
void draw (N5110 &lcd)
 Draw all the components.
void read_input (Gamepad &pad)
 Read the gamepad input.
void update (Gamepad &pad)
 Update the data.
void welcome (Gamepad &pad, N5110 &lcd)
 Print welcome component and wait for start.
void game_over (Gamepad &pad, N5110 &lcd)
 Print game over on the screen.
void play_music (Gamepad &pad)
 Play the music.
void screen_rollup (Gamepad &pad, N5110 &lcd)
 Roll up the picture.
void loading (Gamepad &pad, N5110 &lcd)
 Print loading on the screen.
void tunnel (Gamepad &pad, N5110 &lcd)
 Play the tunnel animation on the screen.
void draw_tunnel (N5110 &lcd)
 Draw the tunnel.
void draw_man (N5110 &lcd)
 Draw the walking man.
void tunnel_print (Gamepad &pad, N5110 &lcd)
 Print message in the tunnel.

Detailed Description

MinerEngine Class.

Class for the structure of the game It includes the control input, menu and other display parts(welcome,select,gameover,etc)

Author:
Yufan Zhong, University of Leeds and SWJTU
Date:
May 2020

Definition at line 22 of file MinerEngine.h.


Constructor & Destructor Documentation

MinerEngine (  )

Constructor.

Definition at line 4 of file MinerEngine.cpp.

~MinerEngine (  )

Destructor.

Definition at line 9 of file MinerEngine.cpp.


Member Function Documentation

void draw ( N5110 lcd )

Draw all the components.

Parameters:
lcd- N5110 library

Definition at line 352 of file MinerEngine.cpp.

void draw_man ( N5110 lcd )

Draw the walking man.

Parameters:
lcd- N5110 library

Definition at line 626 of file MinerEngine.cpp.

void draw_tunnel ( N5110 lcd )

Draw the tunnel.

Parameters:
lcd- N5110 library

Definition at line 602 of file MinerEngine.cpp.

void game_over ( Gamepad pad,
N5110 lcd 
)

Print game over on the screen.

Parameters:
pad- Gamepad library
lcd- N5110 library

Definition at line 452 of file MinerEngine.cpp.

void game_run ( Gamepad pad,
N5110 lcd 
)

Run the game.

Parameters:
pad- Gamepad library
lcd- N5110 library

Definition at line 285 of file MinerEngine.cpp.

int get_select ( Gamepad pad )

Get the select.

Parameters:
pad- Gamepad library

Definition at line 169 of file MinerEngine.cpp.

void init ( int  winch_width,
int  winch_height,
int  gold_num,
int  monster_speed 
)

Initialise the components of the MinerEngine.

Parameters:
winch_width- the width of the winch
winch_height- the height of the winch
gold_num- the gold number
monster_speed- the speed of monster

Definition at line 108 of file MinerEngine.cpp.

void init_unchanged_parameter (  )

Initialise the unchanged parameter.

Definition at line 140 of file MinerEngine.cpp.

void instruction ( Gamepad pad,
N5110 lcd 
)

Print the instruction.

Parameters:
pad- Gamepad library
lcd- N5110 library

Definition at line 181 of file MinerEngine.cpp.

void loading ( Gamepad pad,
N5110 lcd 
)

Print loading on the screen.

Parameters:
pad- Gamepad library
lcd- N5110 library

Definition at line 551 of file MinerEngine.cpp.

void menu ( Gamepad pad,
N5110 lcd 
)

Print the menu.

Parameters:
pad- Gamepad library
lcd- N5110 library

Definition at line 231 of file MinerEngine.cpp.

void options ( Gamepad pad,
N5110 lcd 
)

Select the difficulties.

Parameters:
pad- Gamepad library
lcd- N5110 library

Definition at line 259 of file MinerEngine.cpp.

void play_music ( Gamepad pad )

Play the music.

Parameters:
pad- Gamepad library

Definition at line 476 of file MinerEngine.cpp.

void read_input ( Gamepad pad )

Read the gamepad input.

Parameters:
pad- Gamepad library

Definition at line 341 of file MinerEngine.cpp.

void screen_rollup ( Gamepad pad,
N5110 lcd 
)

Roll up the picture.

Parameters:
pad- Gamepad library
lcd- N5110 library

Definition at line 534 of file MinerEngine.cpp.

void state_switch ( Gamepad pad,
N5110 lcd 
)

Switch the states.

Parameters:
pad- Gamepad library
lcd- N5110 library

Definition at line 145 of file MinerEngine.cpp.

void tunnel ( Gamepad pad,
N5110 lcd 
)

Play the tunnel animation on the screen.

Parameters:
pad- Gamepad library
lcd- N5110 library

Definition at line 579 of file MinerEngine.cpp.

void tunnel_print ( Gamepad pad,
N5110 lcd 
)

Print message in the tunnel.

Parameters:
pad- Gamepad library
lcd- N5110 library

Definition at line 641 of file MinerEngine.cpp.

void update ( Gamepad pad )

Update the data.

Parameters:
pad- Gamepad library

Definition at line 366 of file MinerEngine.cpp.

void welcome ( Gamepad pad,
N5110 lcd 
)

Print welcome component and wait for start.

Parameters:
pad- Gamepad library
lcd- N5110 library

Definition at line 434 of file MinerEngine.cpp.