diff options
| author | cursed22bc <admin@pixeldawn.org> | 2026-03-07 23:43:32 +0200 |
|---|---|---|
| committer | cursed22bc <admin@pixeldawn.org> | 2026-03-07 23:43:32 +0200 |
| commit | aeb596379bbf1bec84efb294ff5bbbee922364ba (patch) | |
| tree | deaf13edba484c5d4013dfd094e515b103e2c9d9 /entity.lua | |
| parent | 8514ffe0a1aa2febe989b2ff0b3044150492a1b2 (diff) | |
basic water render and physics
Diffstat (limited to 'entity.lua')
| -rw-r--r-- | entity.lua | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -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 |
