Subclass of Entity.
More...
#include <DynamicEntity.h>
|
| | DynamicEntity (const double x_, const double y_, Sprite *const sprite_) |
| | The constructor. More...
|
| |
|
virtual | ~DynamicEntity () |
| | The destructor.
|
| |
|
virtual void | jump () |
| |
|
virtual void | applyGravity () |
| |
|
virtual void | move (const bool movingLeft_, const bool movingRight_) |
| |
|
virtual void | slowVx () |
| |
|
virtual void | roll () |
| |
|
virtual void | aim (Crosshair *const crosshair, double direction) |
| |
|
virtual void | useBombPotion (BombPotion *const bombPotion, const int strength, const int distance) |
| |
| virtual void | setLevelWH (const unsigned int width_, const unsigned int height_) |
| |
|
virtual void | setCollisionRects (const std::vector< SDL_Rect > &collisionRects_) |
| |
|
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 () |
| |
|
| virtual void | updatePosition (const double dt_) |
| | Updates the position of the dynamic entity Update is based on what input was recieved, and the players velocity. More...
|
| |
std::array< bool,
CollisionSide::SOLID_TOTAL > | detectCollision () |
| |
|
virtual void | handleCollision (std::array< bool, CollisionSide::SOLID_TOTAL > detections_)=0 |
| | Handles the collision.
|
| |
| | Entity (const double x_, const double y_, Sprite *const sprite_) |
| | The constructor. More...
|
| |
Subclass of Entity.
The objects of this class are entities, but have physics applied to them (such as velocity).
| DynamicEntity::DynamicEntity |
( |
const double |
x_, |
|
|
const double |
y_, |
|
|
Sprite *const |
sprite_ |
|
) |
| |
The constructor.
Initializes all attributes.
- Parameters
-
| x_ | : position in x axis. |
| y_ | : position in y axis. |
| sprite_ | : which sprite to use. |
| std::array< bool, CollisionSide::SOLID_TOTAL > DynamicEntity::detectCollision |
( |
) | |
|
|
protected |
| void DynamicEntity::setLevelWH |
( |
const unsigned int |
width_, |
|
|
const unsigned int |
height_ |
|
) |
| |
|
virtual |
- Parameters
-
| width_,height_ | : Tells the player what the width and height of the level is. |
- See Also
- Level::update()
| void DynamicEntity::updatePosition |
( |
const double |
dt_) | |
|
|
protectedvirtual |
Updates the position of the dynamic entity Update is based on what input was recieved, and the players velocity.
- Parameters
-
| dt_ | : Delta time. Time elapsed between one frame and the other, independent of processing speed. |
- Todo:
- Fix all these magic/weird numbers.
| std::vector<SDL_Rect> DynamicEntity::collisionRects |
|
protected |
The SDL_Rects containing collidable tiles
positions.
| bool DynamicEntity::isGrounded |
Check for if the dynamic entity is on the ground.
| unsigned int DynamicEntity::levelH |
|
protected |
| unsigned int DynamicEntity::levelW |
|
protected |
| double DynamicEntity::maxSpeed |
Dynamic entity max speed.
| double DynamicEntity::speed |
Speed that moves dynamic entity on input.
The dynamic entity's speed on the x axis.
The dynamic entity's speed on the x axis.
The documentation for this class was generated from the following files:
- /home/caio/Git/Dauphine/include/DynamicEntity.h
- /home/caio/Git/Dauphine/src/DynamicEntity.cpp