![]() |
Peoplemon
0.1.0
Peoplemon 3 game source documentation
|
Adding this component to an entity will allow it to move. More...
#include <Movable.hpp>
Public Member Functions | |
Movable (bl::tmap::Position &pos, float speed, float fastSpeed) | |
Construct a new Movable component. More... | |
bool | moving () const |
Returns whether or not the entity is moving. More... | |
bool | goingFast () const |
Returns whether or not the entity is going fast. More... | |
void | move (bl::tmap::Direction dir, bool fast, bool isLedgeHop) |
Starts the entity moving in the given direction. Only updates the interpolated position, not the tile position. This does not check collisions. Use the Movement system to ensure the move is valid. More... | |
void | update (bl::ecs::Entity owner, system::Systems &systems, float dt) |
Updates the interpolation of the entity if moving. More... | |
Friends | |
class | system::Movement |
Adding this component to an entity will allow it to move.
Definition at line 26 of file Movable.hpp.
core::component::Movable::Movable | ( | bl::tmap::Position & | pos, |
float | speed, | ||
float | fastSpeed | ||
) |
Construct a new Movable component.
pos | A handle to the position component of the owning entity |
speed | The speed to move at |
fastSpeed | The speed to move at when moving fast |
Definition at line 37 of file Movable.cpp.
bool core::component::Movable::goingFast | ( | ) | const |
Returns whether or not the entity is going fast.
Definition at line 45 of file Movable.cpp.
void core::component::Movable::move | ( | bl::tmap::Direction | dir, |
bool | fast, | ||
bool | isLedgeHop | ||
) |
Starts the entity moving in the given direction. Only updates the interpolated position, not the tile position. This does not check collisions. Use the Movement system to ensure the move is valid.
dir | The direction to move in |
fast | True to move fast, false to move slow |
isLedgeHop | Indicates whether we are hopping or moving regularly |
Definition at line 47 of file Movable.cpp.
bool core::component::Movable::moving | ( | ) | const |
Returns whether or not the entity is moving.
Definition at line 43 of file Movable.cpp.
void core::component::Movable::update | ( | bl::ecs::Entity | owner, |
system::Systems & | systems, | ||
float | dt | ||
) |
Updates the interpolation of the entity if moving.
owner | The owning entity of this component |
systems | The game systems |
dt | Time elapsed in seconds since last call to update |
Definition at line 53 of file Movable.cpp.
|
friend |
Definition at line 79 of file Movable.hpp.