semi synced multiplayer

This commit is contained in:
harper
2026-08-29 15:24:43 -05:00
parent c5cb04d760
commit 2ed2daeb25
7 changed files with 148 additions and 152 deletions
+7 -7
View File
@@ -1,9 +1,15 @@
require("client.utils")
world = {}
world.tiles = {}
world.entities = {}
world.entities.com = {}
world.entities.players = {}
world.utils = {}
world.cell_size = 10 -- default
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)
return vec(utils.round(x / world.cell_size) * world.cell_size, utils.round(y / world.cell_size) * world.cell_size)
end
function world.utils.set_tile(x, y, tbl)
@@ -15,9 +21,3 @@ function world.utils.get_tile(x, y)
local key = x .. "," .. y
return world.tiles[key]
end
function world:draw()
for i, v in pairs(world.tiles) do
gfx.rect_fill(v.aabb.x, v.aabb.y, v.aabb.w, v.aabb.h, gfx.COLOR_DARK_GRAY)
end
end