From bc52ad3e36ecb0918eca17ea68a0dc54852a3392 Mon Sep 17 00:00:00 2001 From: ne_mene Date: Fri, 13 Mar 2026 17:52:50 +0100 Subject: player is fat, ha ha --- src/objs/player.lua | 2 +- src/objs/tilemap.lua | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'src/objs') diff --git a/src/objs/player.lua b/src/objs/player.lua index c046c7c..82c5ed5 100644 --- a/src/objs/player.lua +++ b/src/objs/player.lua @@ -59,7 +59,7 @@ end function new_player(x, y) local ent = new_entity() - add_comp(ent, "Body", x, y, 16, 16, { + add_comp(ent, "Body", x, y, 64, 64, { offsetx = -8, offsety = -8, layers = {}, diff --git a/src/objs/tilemap.lua b/src/objs/tilemap.lua index 8b1ab76..7904a19 100644 --- a/src/objs/tilemap.lua +++ b/src/objs/tilemap.lua @@ -133,6 +133,13 @@ function get_tile(map, x, y) return map.tiledata[ID(map, x, y)] end +function has_tile(map, x, y) + if x < 0 or x >= map.width or y < 0 or y >= map.height then + return false + end + return map.tiledata[ID(map, x, y)] ~= 0 +end + function queue_tilemap_rebuild(tilemap) tilemap.needs_rebuild = true end -- cgit v1.3-2-g0d8e