ELEC2645 (2019/20) / Mbed 2 deprecated ELEC2645_Project_el19zf

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Collision Class Reference

Collision Class Reference

Collision class. More...

#include <Collision.h>

Public Member Functions

 Collision ()
 constructor
 ~Collision ()
 destructor
void init ()
 init private variables
void reset_check_col ()
 reset col_index to 0
bool check (N5110 &lcd)
 check whether there is a collision
bool check_des (N5110 &lcd)
 check whether people reach destination
void draw (N5110 &lcd)
 draw current health at the left top of lcd
void draw_basic (N5110 &lcd)
 draw basic elements in collision interface
void draw_collision (N5110 &lcd)
 draw the collision interface to tell gamer health - 1
int get_health ()
 accessors get health of people
int get_des ()
 accessors get des_index
bool get_check_col ()
 accessors get col_index
void set_pos (Vector2D pos)
 accessors

Detailed Description

Collision class.

check whether people is shotted

Author:
Zeyu Feng @28 April 2020

Definition at line 16 of file Collision.h.


Constructor & Destructor Documentation

Collision (  )

constructor

Definition at line 13 of file Collision.cpp.

~Collision (  )

destructor

Definition at line 18 of file Collision.cpp.


Member Function Documentation

bool check ( N5110 lcd )

check whether there is a collision

Returns:
whether collide

Definition at line 35 of file Collision.cpp.

bool check_des ( N5110 lcd )

check whether people reach destination

Returns:
whether reach destination

Definition at line 61 of file Collision.cpp.

void draw ( N5110 lcd )

draw current health at the left top of lcd

Definition at line 76 of file Collision.cpp.

void draw_basic ( N5110 lcd )

draw basic elements in collision interface

Definition at line 82 of file Collision.cpp.

void draw_collision ( N5110 lcd )

draw the collision interface to tell gamer health - 1

Definition at line 92 of file Collision.cpp.

bool get_check_col (  )

accessors get col_index

Returns:
game information

Definition at line 119 of file Collision.cpp.

int get_des (  )

accessors get des_index

Returns:
game information

Definition at line 114 of file Collision.cpp.

int get_health (  )

accessors get health of people

Returns:
health of people

Definition at line 109 of file Collision.cpp.

void init (  )

init private variables

Definition at line 23 of file Collision.cpp.

void reset_check_col (  )

reset col_index to 0

Definition at line 30 of file Collision.cpp.

void set_pos ( Vector2D  pos )

accessors

Definition at line 124 of file Collision.cpp.