![]() |
Dauphine
0.1
A platforming/stealth game in a medieval fantasy setting, developed with SDL2.
|
Base class for all game objects (entities). More...
#include <Entity.h>
Public Member Functions | |
| virtual | ~Entity () |
| The destructor. | |
| virtual void | update (const double dt_)=0 |
| Updates the entity. More... | |
| virtual void | render (const double cameraX_, const double cameraY_)=0 |
| Renders the entity. More... | |
| unsigned int | getWidth () |
| unsigned int | getHeight () |
| SDL_Rect & | getAnimationClip () |
Public Attributes | |
| double | x |
| The position in the x axis. More... | |
| double | y |
| The position in the y axis. More... | |
| bool | isRight |
| The direction in the x axis. More... | |
Protected Member Functions | |
| Entity (const double x_, const double y_, Sprite *const sprite_) | |
| The constructor. More... | |
Protected Attributes | |
| Sprite * | sprite |
| The Sprite attributed to the entity. More... | |
| unsigned int | width |
| The entitys width, from its sprite. More... | |
| unsigned int | height |
| The entitys height, from its sprite. More... | |
| SDL_Rect | animationClip |
| The current clip on the spritesheet, to determine animation. More... | |
| SDL_Rect | boundingBox |
Base class for all game objects (entities).
The entity contains the (x,y) position, width and height, and a sprite.
|
protected |
The constructor.
Initializes all the attributes.
| x_ | : position in x axis. |
| y_ | : position in y axis. |
| sprite_ | : which sprite to use. |
| SDL_Rect & Entity::getAnimationClip | ( | ) |
| unsigned int Entity::getHeight | ( | ) |
| unsigned int Entity::getWidth | ( | ) |
|
pure virtual |
Renders the entity.
Pure virtual function. Purpose is to copy the entity's texture onto the renderer.
| cameraX_ | : The x position of the camera. |
| cameraY_ | : The y position of the camera. |
Implemented in Player, Enemy, BombPotion, Text, and Crosshair.
|
pure virtual |
Updates the entity.
Pure virtual function. Purpose is to update whatever is necessary, relative to the entity.
| dt_ | : Delta time. Time elapsed between one frame and the other. |
Implemented in Player, Enemy, BombPotion, Text, and Crosshair.
|
protected |
The current clip on the spritesheet, to determine animation.
|
protected |
The entitys height, from its sprite.
| bool Entity::isRight |
The direction in the x axis.
|
protected |
The entitys width, from its sprite.
| double Entity::x |
The position in the x axis.
| double Entity::y |
The position in the y axis.
1.8.4