mirror of
https://github.com/BlackMATov/evolved.lua.git
synced 2025-12-13 11:38:15 +07:00
29 lines
588 B
Lua
29 lines
588 B
Lua
local evolved = require 'evolved'
|
|
|
|
local registry = evolved.registry()
|
|
|
|
local fragments = {
|
|
position = registry:entity(),
|
|
velocity = registry:entity(),
|
|
}
|
|
|
|
do
|
|
local entity = registry:entity()
|
|
entity:insert(fragments.position)
|
|
entity:insert(fragments.velocity)
|
|
end
|
|
|
|
do
|
|
local query = registry:query(
|
|
fragments.position,
|
|
fragments.velocity)
|
|
|
|
for chunk in query:chunks() do
|
|
local ps = chunk.components[fragments.position]
|
|
local vs = chunk.components[fragments.position]
|
|
|
|
for i = 1, #chunk.entities do
|
|
end
|
|
end
|
|
end
|