summaryrefslogtreecommitdiff
path: root/world.lua
diff options
context:
space:
mode:
authorcursed22bc <admin@pixeldawn.org>2026-03-02 23:16:16 +0200
committercursed22bc <admin@pixeldawn.org>2026-03-02 23:16:16 +0200
commit8514ffe0a1aa2febe989b2ff0b3044150492a1b2 (patch)
tree941c85f21ddda4e8acbd800c25ebf6a9013f0c5f /world.lua
parent255f32f77df817a8059839b4dae1afca20784888 (diff)
trying to debug stuttering
Diffstat (limited to 'world.lua')
-rw-r--r--world.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/world.lua b/world.lua
index c7f2fe4..16324bb 100644
--- a/world.lua
+++ b/world.lua
@@ -303,8 +303,8 @@ function World.drawPhysicsBodyOutlines(entityList)
local body = e.body
if body and e.physicsWidth and e.physicsHeight then
local cx, cy = body:getX(), body:getY()
- local x = cx - e.physicsWidth / 2
- local y = cy - e.physicsHeight / 2
+ local x = math.floor(cx - e.physicsWidth / 2)
+ local y = math.floor(cy - e.physicsHeight / 2)
love.graphics.rectangle("line", x, y, e.physicsWidth, e.physicsHeight)
end
end
@@ -316,7 +316,7 @@ function World.drawEntityDefault(entity)
if entity.isPlayer then
love.graphics.setColor(1, 0.3, 0.2, 1)
end
- love.graphics.rectangle("fill", entity.x, entity.y, entity.width, entity.height)
+ love.graphics.rectangle("fill", math.floor(entity.x), math.floor(entity.y), entity.width, entity.height)
love.graphics.setColor(1, 1, 1, 1)
end