The Controllable struct indicates whether an entity can be controlled by a player or AI and defines its movement speed.
namespace component {
struct Controllable {
bool _controllable;
double _speed;
};
}; // namespace component
Members:
bool _controllable:
A boolean value that specifies if the entity is controllable (true) or not (false).
double _speed:
A floating-point value representing the movement speed of the entity, allowing for dynamic adjustments during gameplay.
The Controllable component is crucial for determining player interaction with entities, facilitating control mechanisms and ensuring that entities respond to user input or AI logic effectively.