4#include <nlohmann/json.hpp>
29 const nlohmann::json &data) {
31 controllable.
speed = data.value(
"speed", 300.0f);
32 controllable.isChargingShoot = data.value(
"isChargingShoot",
false);
void controllableFromJson(rtk::ecs::Registry ®, std::size_t entity, const nlohmann::json &data)
Adds a Controllable to an entity from its blueprint data.
Definition Controllable.hpp:28
Marks an entity as a ship driven by player inputs.
Definition Controllable.hpp:17
float speed
Movement speed in pixels per second.
Definition Controllable.hpp:18
bool isChargingShoot
True while the shoot button is held.
Definition Controllable.hpp:19