From aeb596379bbf1bec84efb294ff5bbbee922364ba Mon Sep 17 00:00:00 2001 From: cursed22bc Date: Sat, 7 Mar 2026 23:43:32 +0200 Subject: basic water render and physics --- entity.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'entity.lua') diff --git a/entity.lua b/entity.lua index d291717..34e37f0 100644 --- a/entity.lua +++ b/entity.lua @@ -38,6 +38,20 @@ function Entity:syncFromPhysicsBody() self.y = self.body:getY() - self.height + self.physicsHeight / 2 end +function getEntityCorners(entity) + local x = entity.x + local y = entity.y + local w = entity.physicsWidth + local h = entity.physicsHeight + + return { + {x = x, y = y}, + {x = x + w, y = y}, + {x = x, y = y + h}, + {x = x + w, y = y + h} + } +end + function Entity:getPhysicsBody() return self.body end -- cgit v1.2.3