Skip to content

System: moving

Autonomous linear movement system.

For each entity with a Moving component, attempt to move it in its configured direction by its speed. If the destination tile is out of bounds or blocked, it applies the configured on_collision behavior.

moving_system(state, ctx)

Advance all moving entities for the current step.

Parameters:

Name Type Description Default
state State

Current game state.

required
ctx StepContext

Current step context.

required

Returns:

Type Description
tuple[State, StepContext]

Updated state and context after processing movement.