Dependencies:
mbed
« Back to documentation index
Block Class Reference
Block class the wall and control the update of the wall's position.
More...
#include <Block.h >
Public Member Functions
Block ()
Constructor.
~Block ()
Destructor.
void blockinit (int x1up, int y1up, int x1down, int y1down, int x2up, int y2up, int x2down, int y2down)
initiate the wall position
void draw_block (N5110 &lcd)
draw the block
void blockupgrate ()
the upgrate of x coordinates for score 1-10(level 1)
void blockupgrate2 ()
the upgrate of x coordinates for score 11-20(level 2)
void blockupgrate3 ()
the upgrate of x coordinates for score 21-30(level 3)
void blockupgrate4 ()
the upgrate of x coordinates for score 31-40(level 4)
void y_update ()
the upgrate of y coordinates
Vector2D getposition1 ()
get the position of x1up and y1up return the vector contains the postion of x1up and y1up
Vector2D getposition2 ()
get the position of x1down and y1down return the vector contains the postion of x1down and y1down
Vector2D getposition3 ()
get the position of x2up and y2up return the vector contains the postion of x2up and y2up
Vector2D getposition4 ()
get the position of x2down and y2down return the vector contains the postion of x2down and y2down
void add_score ()
add score by 1
int get_score ()
get the score
Detailed Description
Block class the wall and control the update of the wall's position.
Author: ZiWei Liu Alex
Date: May,2020
Definition at line 14 of file Block.h .
Constructor & Destructor Documentation
Constructor.
Definition at line 3 of file Block.cpp .
Destructor.
Definition at line 4 of file Block.cpp .
Member Function Documentation
void blockinit
(
int
x1up ,
int
y1up ,
int
x1down ,
int
y1down ,
int
x2up ,
int
y2up ,
int
x2down ,
int
y2down
)
initiate the wall position
Parameters:
8 coordinates for the wall(two lines)
Definition at line 8 of file Block.cpp .
the upgrate of x coordinates for score 1-10(level 1)
Definition at line 27 of file Block.cpp .
the upgrate of x coordinates for score 11-20(level 2)
Definition at line 46 of file Block.cpp .
the upgrate of x coordinates for score 21-30(level 3)
Definition at line 65 of file Block.cpp .
the upgrate of x coordinates for score 31-40(level 4)
Definition at line 135 of file Block.cpp .
void draw_block
(
N5110 &
lcd )
draw the block
Parameters:
Definition at line 21 of file Block.cpp .
get the score
Returns: the current score
Definition at line 183 of file Block.cpp .
get the position of x1up and y1up return the vector contains the postion of x1up and y1up
Definition at line 154 of file Block.cpp .
get the position of x1down and y1down return the vector contains the postion of x1down and y1down
Definition at line 160 of file Block.cpp .
get the position of x2up and y2up return the vector contains the postion of x2up and y2up
Definition at line 166 of file Block.cpp .
get the position of x2down and y2down return the vector contains the postion of x2down and y2down
Definition at line 172 of file Block.cpp .
the upgrate of y coordinates
Definition at line 88 of file Block.cpp .