diff --git a/init.lua b/init.lua index 85dcef6..9b984e7 100644 --- a/init.lua +++ b/init.lua @@ -72,8 +72,7 @@ local function can_occupy(x, y) {x + player.w - 1, y + player.h - 1}, } for _, c in ipairs(corners) do - local tx = math.floor(c[1] / ts) - local ty = math.floor(c[2] / ts) + local tx, ty = engine.spatial.pixel_to_tile(c[1], c[2], ts) if not maps.is_walkable(tx, ty) then return false end end return true