A SystemFn that can be registered with the scheduler.
// Movement system using createSystem helper
const movementSystem = createSystem(
['position', 'velocity'],
(entity, dt) => {
entity.position.x += entity.velocity.x * dt;
entity.position.y += entity.velocity.y * dt;
entity.position.z += entity.velocity.z * dt;
}
);
scheduler.register({
name: 'movement',
fn: movementSystem,
priority: 10
});
Creates a simple system function from a query and update function.
Helper for creating systems that iterate over entities with specific components. Reduces boilerplate for common system patterns.