summaryrefslogtreecommitdiff
path: root/main.lua
diff options
context:
space:
mode:
authorthe lemons <citrons@mondecitronne.com>2022-12-21 15:46:30 -0600
committerthe lemons <citrons@mondecitronne.com>2022-12-21 17:45:51 -0600
commita06622361d858c4d9c78c15323fc0d0e17e94110 (patch)
tree52aa25c53874a4c597cf0cab0824c9ed9ccb7bcb /main.lua
parent619c46c37731df55bd2f50b7bb126c016734796e (diff)
collision detection and correction
Diffstat (limited to 'main.lua')
-rw-r--r--main.lua4
1 files changed, 3 insertions, 1 deletions
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