From 6d5e3252b51b096f88945cdb77f46d1128801d1f Mon Sep 17 00:00:00 2001 From: iamcheeseman Date: Fri, 13 Mar 2026 18:32:52 -0400 Subject: Fix collision resolution at low fps --- src/objs/tilemap.lua | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/objs/tilemap.lua') 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 -- cgit v1.3-2-g0d8e