4#include <nlohmann/json.hpp>
29 const nlohmann::json &data) {
31 velocity.
x = data.value(
"x", 0.0f);
32 velocity.y = data.value(
"y", 0.0f);
void velocityFromJson(rtk::ecs::Registry ®, std::size_t entity, const nlohmann::json &data)
Adds a Velocity to an entity from its blueprint data.
Definition Velocity.hpp:28
Linear speed of an entity.
Definition Velocity.hpp:17
float y
Vertical speed in pixels per second.
Definition Velocity.hpp:19
float x
Horizontal speed in pixels per second.
Definition Velocity.hpp:18