ZIWEI LIU / Mbed 2 deprecated ELEC2645_Project_el19z2l

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Block Class Reference

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

Block (  )

Constructor.

Definition at line 3 of file Block.cpp.

~Block (  )

Destructor.

Definition at line 4 of file Block.cpp.


Member Function Documentation

void add_score (  )

add score by 1

Definition at line 178 of file Block.cpp.

void blockinit ( int  x1up,
int  y1up,
int  x1down,
int  y1down,
int  x2up,
int  y2up,
int  x2down,
int  y2down 
)

initiate the wall position

Parameters:
8coordinates for the wall(two lines)

Definition at line 8 of file Block.cpp.

void blockupgrate (  )

the upgrate of x coordinates for score 1-10(level 1)

Definition at line 27 of file Block.cpp.

void blockupgrate2 (  )

the upgrate of x coordinates for score 11-20(level 2)

Definition at line 46 of file Block.cpp.

void blockupgrate3 (  )

the upgrate of x coordinates for score 21-30(level 3)

Definition at line 65 of file Block.cpp.

void blockupgrate4 (  )

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:
thelcd screen

Definition at line 21 of file Block.cpp.

int get_score (  )

get the score

Returns:
the current score

Definition at line 183 of file Block.cpp.

Vector2D getposition1 (  )

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.

Vector2D getposition2 (  )

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.

Vector2D getposition3 (  )

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.

Vector2D getposition4 (  )

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.

void y_update (  )

the upgrate of y coordinates

Definition at line 88 of file Block.cpp.