Entity kinematics
The code we have written so far would only produce a static, unmoving scene. Since that isn't very exciting, let's work on adding potential for entity movement. Since it calls for more data being stored, we need another component type to work with:
class C_Movable : public C_Base{ public: C_Movable() : C_Base(Component::Movable), m_velocityMax(0.f), m_direction((Direction)0){} void ReadIn(std::stringstream& l_stream){ l_stream >> m_velocityMax >> m_speed.x >> m_speed.y; unsigned int dir = 0; l_stream >> dir; m_direction = static_cast<Direction>(dir); } ... void SetVelocity(const sf::Vector2f& l_vec){ ... } void SetMaxVelocity(float l_vel){ ... } void SetSpeed(const sf::Vector2f& l_vec){ ... } void SetAcceleration(const sf::Vector2f& l_vec){ ... } void SetDirection(const Direction& l_dir){ ... } void AddVelocity(const sf::Vector2f& l_vec){ ... } void...