8 if (position.size() <=
id)
return;
18 for (
auto &&[idx, pos, vel] :
IndexedZipper(positions, velocities)) {
@ P_MOVE
Represents a movement event.
void move_player(Registry &r, std::size_t id, float x, float y)
Moves a player to a specified position.
void movement_system(Registry &r, ComponentContainer< Position > &positions, ComponentContainer< Velocity > &velocities)
Handles the movement of entities based on their velocity.
Manages a collection of components associated with entities in an ECS (Entity-Component-System) archi...
void notify(const GameMessage &event)
Notifies the subscribed listener of an event.
Combines multiple containers into a single iterable unit, iterating over corresponding elements from ...
Manages entities and their associated components, enabling the creation, deletion,...
EventDispatcher * dispatcher
ComponentContainer< Component > & get_components()
Retrieves the component container for a specific type.
float deltaTime
The time difference between the current frame and the last frame.
Represents the position of an entity in a 2D space.