Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
Ukendio committed Jul 30, 2024
1 parent c7be895 commit 4e21367
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions docs/api/query.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,20 +89,24 @@ world

### archetypes()
```luau
function query:archetypes(): { Archetype }
function query.archetypes(): { Archetype }
```
Returns the matching archetypes of the query.

Example:
::: code-group

```luau [luau]
for i, archetype in world:query(Position, Velocity):archetypes() do
local field = archetype.records
for i, archetype in world:query(Position, Velocity).archetypes() do
local columns = archetype.columns
local field = archetype.records
local P = field[Position]
local V = field[Velocity]
for row, entity in archetype.entities do
local position = columns[field[Position]][row]
local velocity = columns[field[Velocity]][row]
local position = columns[P][row]
local velocity = columns[V][row]
-- Do something
end
end
Expand Down

0 comments on commit 4e21367

Please sign in to comment.