Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
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.
- 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 character and the boundry of the character
- Parameters:
-
lcd and 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,gamepad and 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,gamepad and 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:
-
the coordinates of walls, character
Definition at line 7 of file DodgeEngine.cpp.
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,gamepad and 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.
Generated on Sat Jul 16 2022 00:49:05 by
