diff options
| author | Eltrac <hi@guhub.cn> | 2025-02-27 16:44:53 +0800 |
|---|---|---|
| committer | Eltrac <hi@guhub.cn> | 2025-02-27 16:44:53 +0800 |
| commit | 240208c0e00d51beaea3b58d30ba17f981443323 (patch) | |
| tree | 1bef10edcc8b5bd3ca88f3ff04cba2e5c10955a1 /objects/Body.lua | |
| parent | eba04111521bed0ffb1595a21c6fb3c1ee0bd856 (diff) | |
feat: add lancer's sprite
Diffstat (limited to 'objects/Body.lua')
| -rw-r--r-- | objects/Body.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/objects/Body.lua b/objects/Body.lua index 566ff9c..f6d2d0d 100644 --- a/objects/Body.lua +++ b/objects/Body.lua @@ -56,12 +56,12 @@ function Body:drawSprite(spriteName, x, y, angle) ) end -function Body:drawQuad(sheet, index, x, y, angle) +function Body:drawQuad(sheet, index, x, y, angle, zoom) local quad = quads[sheet][index] + local w, h = (self.shape == "circle" and self.r or self.w), (self.shape == "circle" and self.r or self.h) + w, h = w / 16 * (zoom or 1), h / 16 * (zoom or 1) - love.graphics.draw(sprites[sheet], quad, x, y, angle or 0, - w / 16, - h / 16 + love.graphics.draw(sprites[sheet], quad, x - w / 2, y - h / 2, angle or 0, w, h ) end |
