Hugo Hu / Mbed 2 deprecated BRAVEHEART

Dependencies:   mbed N5110 ShiftReg PinDetect

Embed: (wiki syntax)

« Back to documentation index

Entity Class Reference

Entity Class Reference

An entity represents a movable character, such as the player, enemies etc. More...

#include <Global.h>

Inherited by Enemy.

Public Member Functions

int getRight ()
 Returns x-position of the right edge.
int getBottom ()
 Returns y-position of the bottom edge.

Data Fields

int x
 Position of entity (origin: left upper corner)
int vx
 Velocity of entity.
int width
 Width of entity.
int height
 Height of entity.
bool facingLeft
 True if the entity is facing left.
bool dead
 True if enemy is dead.

Detailed Description

An entity represents a movable character, such as the player, enemies etc.

Note that the entity class does not contain the sprite (image) of the entity. Different sprites are given as 2D const int arrays in OBS! The entity's dimensions should be the same as the width and height or else this will lead to undefined behaviour!

Definition at line 73 of file Global.h.


Member Function Documentation

int getBottom (  )

Returns y-position of the bottom edge.

Definition at line 101 of file Global.h.

int getRight (  )

Returns x-position of the right edge.

Definition at line 98 of file Global.h.


Field Documentation

bool dead

True if enemy is dead.

Definition at line 95 of file Global.h.

bool facingLeft

True if the entity is facing left.

Definition at line 92 of file Global.h.

int height

Height of entity.

Definition at line 89 of file Global.h.

int vx

Velocity of entity.

Definition at line 83 of file Global.h.

int width

Width of entity.

Definition at line 86 of file Global.h.

int x

Position of entity (origin: left upper corner)

Definition at line 80 of file Global.h.