#include <Entity.h>
Inheritance diagram for Entity:
Public Methods | |
Entity () | |
Default constructor. | |
Entity (const Rect &initPos, int initDir) | |
Constructor. | |
virtual | ~Entity () |
Destructor. | |
virtual bool | checkCollision (const Entity *otherEntity) |
Returns true if this entity is colliding with the given entity. | |
virtual void | doCollision (Entity *otherEntity) |
Handles the collision between 2 entities by finding what type of entities they are and then handling the different types of collisions;. | |
virtual bool | update (float dt)=0 |
Update the game logic. | |
virtual void | draw (const Point &anchor)=0 |
Draw this entity on the screen, given the anchor point on the screen, which is defined as the center of the Entity's contact with the ground. | |
virtual const Rect & | getPosition () const |
Get the current position on the map. | |
int | getDirection () const |
Get the direction this Entity is currently facing. | |
void | reverseDirection () |
Reverses the direction the entity is facing. | |
Protected Attributes | |
Rect | pos |
The current position on the map. | |
Animation | anim |
The animation responsible for drawing. | |
int | direction |
The direction this entity is currently facing. | |
float | cachedHeight |
Height value for use by children who may want to cache their heights. |
|
Default constructor. Authors: Jim Clase, Jonathan Hilliker, Jason Winnebeck |
|
Constructor.
|
|
Destructor.
|
|
Returns true if this entity is colliding with the given entity.
Reimplemented in Character. |
|
Handles the collision between 2 entities by finding what type of entities they are and then handling the different types of collisions;.
Reimplemented in Bomb, Character, and ThrownBomb. |
|
Draw this entity on the screen, given the anchor point on the screen, which is defined as the center of the Entity's contact with the ground.
Implements Drawable. Implemented in Bomb, Character, Explosion, HomingBomb, Powerup, and ThrownBomb. |
|
Get the direction this Entity is currently facing.
|
|
Get the current position on the map.
Implements Drawable. |
|
Reverses the direction the entity is facing.
|
|
Update the game logic.
Implemented in Bomb, Character, Explosion, HomingBomb, Powerup, and ThrownBomb. |
|
The animation responsible for drawing.
|
|
Height value for use by children who may want to cache their heights.
|
|
The direction this entity is currently facing.
|
|
The current position on the map.
|