aboutsummaryrefslogtreecommitdiff
path: root/src/objs/tilemap.lua
diff options
context:
space:
mode:
authoriamcheeseman <[email protected]>2026-03-13 18:32:52 -0400
committeriamcheeseman <[email protected]>2026-03-13 18:32:52 -0400
commit6d5e3252b51b096f88945cdb77f46d1128801d1f (patch)
tree57150e9de1c01d147b1511839304040c3cc66948 /src/objs/tilemap.lua
parent88d65e65eb92c8e086bdbb7d938bbb44522caf6f (diff)
Fix collision resolution at low fps
Diffstat (limited to 'src/objs/tilemap.lua')
-rw-r--r--src/objs/tilemap.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/objs/tilemap.lua b/src/objs/tilemap.lua
index 834a770..90b8c8a 100644
--- a/src/objs/tilemap.lua
+++ b/src/objs/tilemap.lua
@@ -153,6 +153,11 @@ function to_tile_coords(x, y)
return math.floor(x / TILESIZE), math.floor(y / TILESIZE)
end
+function get_tile_rect(x, y)
+ x, y = to_tile_coords(x, y)
+ return x*TILESIZE, y*TILESIZE, TILESIZE, TILESIZE
+end
+
function remove_tile(map, x, y)
map.tiledata[ID(map, x, y)] = 0
map.needs_rebuild = true