From 1ce654dbe1727153d31659e257ffc64e6815a35b Mon Sep 17 00:00:00 2001 From: Eltrac Date: Tue, 11 Mar 2025 12:09:10 +0800 Subject: refactor: implement physics engine replace original moving logic and collision detection with love.physics --- objects/Body.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'objects/Body.lua') diff --git a/objects/Body.lua b/objects/Body.lua index c473c69..d5a4e58 100644 --- a/objects/Body.lua +++ b/objects/Body.lua @@ -43,7 +43,7 @@ function Body:draw(x, y) if self.shape == "circle" then love.graphics.circle("fill", x, y, self.r) elseif self.shape == "rectangle" then - love.graphics.rectangle("fill", x, y, self.w, self.h) + love.graphics.rectangle("fill", x - self.w / 2, y - self.h / 2, self.w, self.h) end end -- cgit v1.2.3