#ifndef PLAYER_HPP_ #define PLAYER_HPP_ #include #include #include #include constexpr const float PLAYER_SPEED_CONSTANT = 0.15f; class PlayerSystem : public entityx::System, public entityx::Receiver { private: entityx::Entity player; bool moveLeft; bool moveRight; float speed; public: PlayerSystem(void) : moveLeft(false), moveRight(false), speed(1.0f) {} void create(void); void configure(entityx::EventManager&); void update(entityx::EntityManager &en, entityx::EventManager &ev, entityx::TimeDelta dt) override; void receive(const KeyUpEvent&); void receive(const KeyDownEvent&); vec2 getPosition(void) const; inline void setX(const float& x) { player.component().get()->x = x; } }; #endif // PLAYER_HPP_