diff options
Diffstat (limited to 'src/objs')
| -rw-r--r-- | src/objs/player.lua | 2 | ||||
| -rw-r--r-- | src/objs/tilemap.lua | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/objs/player.lua b/src/objs/player.lua index 58e5f3a..ec04204 100644 --- a/src/objs/player.lua +++ b/src/objs/player.lua @@ -23,7 +23,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 cb29a40..834a770 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 |
