mirror of
https://github.com/Ukendio/jecs.git
synced 2025-08-04 03:09:18 +00:00
Update README.md
This commit is contained in:
parent
a9cde98508
commit
0cb994db0d
1 changed files with 11 additions and 0 deletions
11
README.md
11
README.md
|
@ -46,4 +46,15 @@ end
|
|||
-- "alice"
|
||||
-- bob is the child of alice
|
||||
-- sara is the child of alice
|
||||
|
||||
local Position = world:component()
|
||||
local Velocity = world:component()
|
||||
|
||||
local function things_move(world, dt)
|
||||
for e, p, v in world:query(Position, Velocity) do
|
||||
world:set(e, Position, p + v * dt)
|
||||
end
|
||||
end
|
||||
|
||||
things_move(world, 1/60)
|
||||
```
|
||||
|
|
Loading…
Reference in a new issue