diff options
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 |
