Creates a Creature object that inherits Entity. Creates a Creature object that inherits Entity and contains the details for the Creature.
More...
#include <creature.h>
|
| | Creature (Texture *, Vec2, Vec2, int, int, int, int) |
| |
| | ~Creature () |
| |
| void | updatePosition (float) |
| |
| void | setVelocities (Vec2) |
| |
| Vec2 | getVelocities () |
| |
| void | displayTiles (SDL_Renderer *, Map *) |
| |
| void | collisionUpdate (Map *, float) |
| |
| void | collisionUpdate (Entity *, float) |
| |
| | Entity (Texture *, Vec2, Vec2, int, int, int, int) |
| |
| | ~Entity () |
| |
| void | display (SDL_Renderer *) |
| |
| void | setPosition (Vec2) |
| |
| Vec2 | getPosition () |
| |
| int | getWidth () |
| |
| int | getHeight () |
| |
|
| float | collision (Map *, float, float, float, int, int, int, int, char) |
| |
| void | displayCollisionTest (SDL_Renderer *, Map *, int, int, int, int) |
| |
Creates a Creature object that inherits Entity. Creates a Creature object that inherits Entity and contains the details for the Creature.
| Creature::Creature |
( |
Texture * |
inTexture, |
|
|
Vec2 |
inPos, |
|
|
Vec2 |
inSource, |
|
|
int |
inSpriteW, |
|
|
int |
inSpriteH, |
|
|
int |
w, |
|
|
int |
h |
|
) |
| |
| float Creature::collision |
( |
Map * |
map, |
|
|
float |
dt, |
|
|
float |
velocity, |
|
|
float |
currentPos, |
|
|
int |
minI, |
|
|
int |
maxI, |
|
|
int |
minJ, |
|
|
int |
maxJ, |
|
|
char |
axis |
|
) |
| |
|
protected |
Tests if the Creature collides with a Wall for a certain direction and performs an act upon the result
- Parameters
-
| Map | * A pointer to the Map |
| float | The delta time |
| float | The velocity from the axis to be tested |
| float | The position from the axis to be tested |
| int | The minimum i index |
| int | The maximum i index |
| int | The minimum j index |
| int | The maximum j index |
| char | The axis being checked |
| float | Returns the new velocity. |
| void Creature::collisionUpdate |
( |
Map * |
map, |
|
|
float |
dt |
|
) |
| |
Tests if the Creature collides with a Wall and performs an act upon the result
- Parameters
-
| Map | * A pointer to the Map |
| float | The delta time |
| void Creature::collisionUpdate |
( |
Entity * |
entity, |
|
|
float |
dt |
|
) |
| |
Tests if the Creature collides with an Entity and performs an act upon the result
- Parameters
-
| Map | * A pointer to the Entity |
| float | The delta time |
| void Creature::displayCollisionTest |
( |
SDL_Renderer * |
renderer, |
|
|
Map * |
map, |
|
|
int |
minI, |
|
|
int |
maxI, |
|
|
int |
minJ, |
|
|
int |
maxJ |
|
) |
| |
|
protected |
Display tiles being tested for collision
- Parameters
-
| SDL_Renderer | * A pointer to the renderer |
| Map | * A pointer to the Map |
| int | The minimum i index |
| int | The maximum i index |
| int | The minimum j index |
| int | The maximum j index |
| void Creature::displayTiles |
( |
SDL_Renderer * |
renderer, |
|
|
Map * |
map |
|
) |
| |
Display the tiles that the Creature occupies
- Parameters
-
| SDL_Renderer | * A pointer to the renderer |
| Map | * A pointer to the Map |
| Vec2 Creature::getVelocities |
( |
| ) |
|
Getter # Gets the velocities
- Returns
- Vec2 The velocities
| void Creature::setVelocities |
( |
Vec2 |
inVelocities | ) |
|
Setter # Sets the velocities
- Parameters
-
| void Creature::updatePosition |
( |
float |
dt | ) |
|
Updates the Creature position using the velocities and the delta time
- Parameters
-
The min and max tiles that the creature is on
| Vec2 Creature::velocities |
|
protected |
The documentation for this class was generated from the following files: