initial commit

This commit is contained in:
harper
2026-05-14 20:14:48 -07:00
commit 9d65ca32c4
11 changed files with 846 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
world = {}
world.tiles = {}
world.utils = {}
world.cell_size = 10
function world.utils.update_colliders()
for i, v in pairs(world.tiles) do
collision.add(v.aabb)
end
end
function world.utils.to_tile(x, y)
return vec(util.round(x / world.cell_size) * world.cell_size, util.round(y / world.cell_size) * world.cell_size)
end
function world.utils.set_tile(x, y, tbl)
local key = x .. "," .. y
world.tiles[key] = tbl
end
function world.utils.get_tile(x, y)
local key = x .. "," .. y
return world.tiles[key]
end