Compare commits

...

2 commits

Author SHA1 Message Date
Marcus
0cb994db0d
Update README.md 2025-06-13 01:06:33 +02:00
Marcus
a9cde98508
Update README.md 2025-06-13 01:04:06 +02:00

View file

@ -38,12 +38,23 @@ world:set(sara, Name, "sara")
print(getName(parent(sara)))
for e in world:query(pair(ChildOf, alice)) do
print(getName(e), "is the child of alice")
for e, name in world:query(Name, pair(ChildOf, alice)) do
print(name, "is the child of alice")
end
-- Output
-- "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)
```