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.
Dependencies: N5110 PinDetect PowerControl mbed
Entity Class Reference
An entity represents a movable character, such as the player, enemies etc. More...
#include <Entity.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 | onGround |
True if entity is standing on the ground. | |
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 10 of file Entity.h.
Member Function Documentation
Field Documentation
bool facingLeft |
Generated on Tue Jul 12 2022 21:59:48 by
