ZIWEI LIU / Mbed 2 deprecated ELEC2645_Project_el19z2l

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

DodgeEngine Class Reference

DodgeEngine Class Reference

DodgeEngine class engine of the whole game. More...

#include <DodgeEngine.h>

Public Member Functions

 DodgeEngine ()
 Constructor.
 ~DodgeEngine ()
 Destructor.
void charactermove (N5110 &lcd, Gamepad &pad)
 control the movement of character and the boundry of the character
void blockmove (N5110 &lcd)
 control the movement of blockmove
void dodgeupdate (N5110 &lcd, Gamepad &pad, int x1up, int y1up, int x1down, int y1down, int x2up, int y2up, int x2down, int y2down, int manx, int many)
 update the wall's movement and the score
void init (int x1up, int y1up, int x1down, int y1down, int x2up, int y2up, int x2down, int y2down, int manx, int many)
 initate the character and wall
void check_crash (N5110 &lcd, Gamepad &pad, int x1up, int y1up, int x1down, int y1down, int x2up, int y2up, int x2down, int y2down, int manx, int many)
 check if the character has collide with the wall
void print_score (N5110 &lcd, Gamepad &pad, int x1up, int y1up, int x1down, int y1down, int x2up, int y2up, int x2down, int y2down, int manx, int many)
 print the score on the top left corner
void show_score (N5110 &lcd)
 show the score when game is over(failed)
void pass_game (N5110 &lcd, Gamepad &pad)
 show the score when game is over(passed)

Detailed Description

DodgeEngine class engine of the whole game.

Author:
ZiWei Liu Alex
Date:
May,2020

Definition at line 17 of file DodgeEngine.h.


Constructor & Destructor Documentation

DodgeEngine (  )

Constructor.

Definition at line 4 of file DodgeEngine.cpp.

~DodgeEngine (  )

Destructor.

Definition at line 5 of file DodgeEngine.cpp.


Member Function Documentation

void blockmove ( N5110 lcd )

control the movement of blockmove

Parameters:
lcd

Definition at line 24 of file DodgeEngine.cpp.

void charactermove ( N5110 lcd,
Gamepad pad 
)

control the movement of character and the boundry of the character

Parameters:
lcdand gamepad

Definition at line 14 of file DodgeEngine.cpp.

void check_crash ( N5110 lcd,
Gamepad pad,
int  x1up,
int  y1up,
int  x1down,
int  y1down,
int  x2up,
int  y2up,
int  x2down,
int  y2down,
int  manx,
int  many 
)

check if the character has collide with the wall

Parameters:
lcd,gamepadand the coordinates of the character,walls

Definition at line 71 of file DodgeEngine.cpp.

void dodgeupdate ( N5110 lcd,
Gamepad pad,
int  x1up,
int  y1up,
int  x1down,
int  y1down,
int  x2up,
int  y2up,
int  x2down,
int  y2down,
int  manx,
int  many 
)

update the wall's movement and the score

Parameters:
lcd,gamepadand the coordinates of walls, character

Definition at line 31 of file DodgeEngine.cpp.

void init ( int  x1up,
int  y1up,
int  x1down,
int  y1down,
int  x2up,
int  y2up,
int  x2down,
int  y2down,
int  manx,
int  many 
)

initate the character and wall

Parameters:
thecoordinates of walls, character

Definition at line 7 of file DodgeEngine.cpp.

void pass_game ( N5110 lcd,
Gamepad pad 
)

show the score when game is over(passed)

Parameters:
lcd

Definition at line 168 of file DodgeEngine.cpp.

void print_score ( N5110 lcd,
Gamepad pad,
int  x1up,
int  y1up,
int  x1down,
int  y1down,
int  x2up,
int  y2up,
int  x2down,
int  y2down,
int  manx,
int  many 
)

print the score on the top left corner

Parameters:
lcd,gamepadand the coordinates of the character, walls

Definition at line 133 of file DodgeEngine.cpp.

void show_score ( N5110 lcd )

show the score when game is over(failed)

Parameters:
lcd

Definition at line 158 of file DodgeEngine.cpp.