summaryrefslogtreecommitdiff
path: root/objects/Body.lua
diff options
context:
space:
mode:
Diffstat (limited to 'objects/Body.lua')
-rw-r--r--objects/Body.lua30
1 files changed, 0 insertions, 30 deletions
diff --git a/objects/Body.lua b/objects/Body.lua
index 4ca50d1..30ac165 100644
--- a/objects/Body.lua
+++ b/objects/Body.lua
@@ -15,34 +15,4 @@ function Body:new(shape, sizeA, sizeB, zoom)
return obj
end
-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 - self.w / 2, y - self.h / 2, self.w, self.h)
- end
-end
-
-function Body:drawSprite(spriteName, x, y, angle)
- local sprite = sprite.get(spriteName)
- local w, h = (self.shape == "circle" and self.r or self.w), (self.shape == "circle" and self.r or self.h)
-
- love.graphics.draw(sprite, x, y, angle,
- w / sprite:getWidth(),
- h / sprite:getHeight()
- )
-end
-
-function Body:drawQuad(sheet, index, x, y, angle)
- if self.shape == "circle" then
- local r = self.r
- local graphicR = r * self.zoom
- sprite.drawQuad(sheet, index, x - r, y - r, graphicR, graphicR, angle or 0)
- else
- local w, h = self.w, self.h
- local graphicW, graphicH = w * self.zoom, h * self.zoom
- sprite.drawQuad(sheet, index, x - w/2, y - h/2, graphicW, graphicH, angle or 0)
- end
-end
-
return Body