diff options
| author | the lemons <citrons@mondecitronne.com> | 2022-12-22 03:34:24 -0600 |
|---|---|---|
| committer | the lemons <citrons@mondecitronne.com> | 2022-12-22 03:34:24 -0600 |
| commit | b2501ddc96481dd8f5a5dd6a40e3db785bab6ae3 (patch) | |
| tree | 59443867754598666a3b5af848f307c65fb473c0 /world.lua | |
| parent | 93037f358c167425e9e4f071c72f4e07aa5f2fad (diff) | |
selection (it doesn't do anything)
Diffstat (limited to 'world.lua')
| -rw-r--r-- | world.lua | 27 |
1 files changed, 0 insertions, 27 deletions
@@ -31,31 +31,4 @@ function world.chunk(x, y) return world.chunks[cx][cy] end -function world.object(id) - return world.objects[id] -end - -function world.all() - return coroutine.wrap(function() - for _, o in pairs(world.objects) do - coroutine.yield(o) - end - end) -end - -function world.in_box(x1, y1, x2, y2) - return coroutine.wrap(function() - for x = x1, x2 + world.chunk_size, world.chunk_size do - for y = y1, y2 + world.chunk_size, world.chunk_size do - for _, o in pairs(world.chunk(x, y).objects) do - local x, y = unpack(o.data.pos) - if x >= x1 and x <= x2 and y >= y1 and y <= y2 then - coroutine.yield(o) - end - end - end - end - end) -end - return world |
