aboutsummaryrefslogtreecommitdiff
path: root/src/objs
diff options
context:
space:
mode:
Diffstat (limited to 'src/objs')
-rw-r--r--src/objs/player.lua2
-rw-r--r--src/objs/tilemap.lua5
2 files changed, 6 insertions, 1 deletions
diff --git a/src/objs/player.lua b/src/objs/player.lua
index ec04204..58e5f3a 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, 64, 64, {
+ add_comp(ent, "Body", x, y, 16, 16, {
offsetx = -8,
offsety = -8,
layers = {},
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