mirror of
https://github.com/Ukendio/jecs.git
synced 2025-04-24 17:10:03 +00:00
Fix overview example (#120)
This commit is contained in:
parent
e957ca2da9
commit
f2ab8e0b06
1 changed files with 2 additions and 2 deletions
|
@ -44,7 +44,7 @@ local Position = world:component()
|
||||||
local Velocity = world:component()
|
local Velocity = world:component()
|
||||||
|
|
||||||
for id, position, velocity in world:query(Position, Velocity) do
|
for id, position, velocity in world:query(Position, Velocity) do
|
||||||
world:set(id, Position, position += velocity)
|
world:set(id, Position, position + velocity)
|
||||||
world:set(id, Velocity, velocity * 0.9)
|
world:set(id, Velocity, velocity * 0.9)
|
||||||
end
|
end
|
||||||
```
|
```
|
||||||
|
@ -57,7 +57,7 @@ const Position = world.component()
|
||||||
const Velocity = world.component()
|
const Velocity = world.component()
|
||||||
|
|
||||||
for (const [id, position, velocity] of world.query(Position, Velocity)) {
|
for (const [id, position, velocity] of world.query(Position, Velocity)) {
|
||||||
world.set(id, Position, position.add(velocity)
|
world.set(id, Position, position.add(velocity))
|
||||||
world.set(id, Velocity, velocity.mul(0.9))
|
world.set(id, Velocity, velocity.mul(0.9))
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in a new issue