# the smallest program that exercises the whole ECS pipeline program Hello { property Position { column: int = 0, row: int = 0 } property Velocity { delta_x: int = 0, delta_y: int = 0 } handler SpawnEnemies phase Start { spawn Enemy { Position { column: 3, row: 4 }, Velocity { delta_x: 1, delta_y: 0 } } spawn Enemy { Position { column: 10, row: 2 }, Velocity { delta_x: 0, delta_y: 1 } } } # a handler declares the entities it touches; the body # runs once per match, each property bound by name. @Queries(these: [Position, Velocity]) handler AdvancePositions phase FixedUpdate { Position.column += Velocity.delta_x Position.row = Position.row + Velocity.delta_y } handler ReportPositions phase Update { for (moving) in query [Position] { print(moving.column) print(moving.row) } quit() } }