Query
query is the loop statement for iterating over ECS entities: it filters entities by component type, binds component fields into the loop body as variable views, and reads and writes go straight to host storage. For declaring components see Components.
Forms
Full syntax ([...] marks an optional slot):
query ([ref] name: ComponentType, ...) [with C1, C2] [without C3] [label L] { statements... }public func UpdateMovement(dt: float) -> void
{
query (ref pos: Position, vel: Velocity) with Enemy without Dead
{
val id = entity;
pos.X += vel.X * dt;
pos.Y += vel.Y * dt;
Runtime.Print("entity", id, "moved to", pos.X, pos.Y);
}
}编写到此Written up to here
本页其余部分尚未完成,内容随时补充。The rest of this page is not written yet; more content will follow.
Last updated on October 11, 2026
