Simple C++ Game
|
A component for storing the 2D velocity of an entity. More...
#include <Components.hpp>
Public Member Functions | |
VelocityComponent () | |
Construct a new Velocity Component object. More... | |
![]() | |
Component (const std::string id) | |
Construct a new Component object. More... | |
virtual | ~Component () |
This is only declared to make the class polymorphic so that dymaic_cast between Component types works. | |
const std::string | getId () const |
Get the ID of the component. This will return the same value for all instances of a class of Component. | |
Public Attributes | |
sf::Vector2f | velocity |
The entity's velocity. | |
Static Public Attributes | |
static const std::string | VEL_COMP_ID |
The ID of a VelocityComponent. | |
A component for storing the 2D velocity of an entity.
VelocityComponent::VelocityComponent | ( | ) |
Construct a new Velocity Component object.
The velocity defaults to (0, 0)