aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.lua7
-rw-r--r--src/phys.lua3
2 files changed, 10 insertions, 0 deletions
diff --git a/main.lua b/main.lua
index 517a948..bbc2689 100644
--- a/main.lua
+++ b/main.lua
@@ -68,5 +68,12 @@ function love.draw(dt)
SCR_WIDTH / 2, SCR_HEIGHT / 2)
lg.print(tostring(love.timer.getFPS()))
+ lg.print("left "..tostring(player.box:touching_left()), 0, 20)
+ lg.print("right "..tostring(player.box:touching_right()), 0, 40)
+ lg.print("horizontal "..tostring(player.box:touching_horizontal()), 0, 60)
+ lg.print("up "..tostring(player.box:touching_up()), 0, 80)
+ lg.print("down "..tostring(player.box:touching_down()), 0, 100)
+ lg.print("vertical "..tostring(player.box:touching_vertical()), 0, 120)
+ lg.print("any "..tostring(player.box:touching()), 0, 140)
input_step()
end
diff --git a/src/phys.lua b/src/phys.lua
index 10691a9..126b5a8 100644
--- a/src/phys.lua
+++ b/src/phys.lua
@@ -127,6 +127,9 @@ function phys.Box:update(velx, vely, dt)
local small_side = math.min(self.width, self.height)
local steps = math.ceil(vec_len(velx * dt, vely * dt) / small_side)
+ self.touchx = 0
+ self.touchy = 0
+
-- this block is fat. much like a certain croatian...
-- not anymore :D
-- shut up