From 80564184d492227d4a403358e0f3ffdef0ff008e Mon Sep 17 00:00:00 2001 From: ne_mene Date: Thu, 12 Mar 2026 20:03:59 +0100 Subject: touch reset --- main.lua | 7 +++++++ src/phys.lua | 3 +++ 2 files changed, 10 insertions(+) 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 -- cgit v1.3-2-g0d8e