27 lines
580 B
Lua
Executable File
27 lines
580 B
Lua
Executable File
local circleStack
|
|
local starting_radius = 250
|
|
|
|
function insertCircle(pos, radius)
|
|
|
|
if radius > 2 then
|
|
table.insert(circleStack, {pos, radius})
|
|
end
|
|
end
|
|
|
|
function drawCircle(pos, radius)
|
|
love.graphics.circle("line", pos.x, pos.y, radius)
|
|
local offset = Vector2(radius)
|
|
insertCircle(pos + offset, radius/2)
|
|
insertCircle(pos - offset, radius/2)
|
|
end
|
|
|
|
|
|
return function(offset, scale)
|
|
circleStack = {}
|
|
insertCircle(-offset/scale, starting_radius/scale)
|
|
|
|
while #circleStack > 0 do
|
|
local circle = table.remove(circleStack)
|
|
drawCircle(unpack(circle))
|
|
end
|
|
end |