1 #ifndef CORE_COMPONENTS_MOVABLE_HPP
2 #define CORE_COMPONENTS_MOVABLE_HPP
4 #include <BLIB/Engine/Engine.hpp>
5 #include <BLIB/Events.hpp>
6 #include <BLIB/Tilemap/Position.hpp>
7 #include <SFML/System/Vector2.hpp>
35 Movable(bl::tmap::Position& pos,
float speed,
float fastSpeed);
58 void move(bl::tmap::Direction dir,
bool fast,
bool isLedgeHop);
70 enum struct MoveState : std::uint8_t { Still, Moving, MovingFast, LedgeHopping };
72 bl::tmap::Position& position;
74 float fastMovementSpeed;
75 float interpRemaining;
76 bl::tmap::Direction moveDir;
Core classes and functionality for both the editor and game.
Adding this component to an entity will allow it to move.
bool goingFast() const
Returns whether or not the entity is going fast.
bool moving() const
Returns whether or not the entity is moving.
void update(bl::ecs::Entity owner, system::Systems &systems, float dt)
Updates the interpolation of the entity if moving.
Movable(bl::tmap::Position &pos, float speed, float fastSpeed)
Construct a new Movable component.
void move(bl::tmap::Direction dir, bool fast, bool isLedgeHop)
Starts the entity moving in the given direction. Only updates the interpolated position,...
Primary System for managing entity movement and interpolation.
Owns all primary systems and a reference to the engine.