33 lines
612 B
Lua
33 lines
612 B
Lua
Burger = {}
|
|
|
|
local gfx <const> = playdate.graphics
|
|
|
|
function Burger.reset(o)
|
|
o.position = {
|
|
x = 20,
|
|
y = 50,
|
|
}
|
|
o.velocity = {
|
|
x = 50 + (150 * math.random()),
|
|
y = 150 * (math.random() - 1),
|
|
}
|
|
o.size = {
|
|
x = 10,
|
|
y = 10,
|
|
}
|
|
o.canBeBounced = {
|
|
flat = { x = 0, y = 0 },
|
|
mult = { x = 1, y = 1 },
|
|
}
|
|
o.mass = T.marker
|
|
return o
|
|
end
|
|
|
|
function Burger.new()
|
|
return setmetatable(Burger.reset({}), { __index = Burger })
|
|
end
|
|
|
|
function Burger:draw()
|
|
gfx.fillCircleAtPoint(burger.position.x, burger.position.y, 10)
|
|
end
|