summaryrefslogtreecommitdiff
path: root/objects/Body.lua
blob: 30ac165308dde451cd368623a1a9dd9fec6f2ac6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
local Body = {}
Body.__index = Body

function Body:new(shape, sizeA, sizeB, zoom)
    local obj = {
        shape = shape,
        r = (shape == "circle" and sizeA or nil),
        w = (shape == "rectangle" and sizeA or nil),
        h = (shape == "rectangle" and sizeB or nil),
        zoom = zoom or 1
    }

    setmetatable(obj, Body)

    return obj
end

return Body