From a06622361d858c4d9c78c15323fc0d0e17e94110 Mon Sep 17 00:00:00 2001 From: the lemons Date: Wed, 21 Dec 2022 15:46:30 -0600 Subject: collision detection and correction --- main.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'main.lua') diff --git a/main.lua b/main.lua index ebef333..392fa05 100644 --- a/main.lua +++ b/main.lua @@ -68,7 +68,9 @@ function love.draw() end end -- draw all possibly visible objects - for o in world.iterate(cx1 - 20, cy1 - 20, cx2 + 20, cy2 + 20) do + for o in world.in_box( + cx1 - obj.max_size, cy1 - obj.max_size, + cx2 + obj.max_size, cy2 + obj.max_size) do set_color(1, 1, 1) o:draw() end -- cgit v1.2.3