local rx = 0
local ry = 0
function onCreate()
my.variables.rotSpeedX = math.random() * 1.5 + 0.5
my.variables.rotSpeedY = math.random() * 1.5 + 0.5
my.variables.colorR = math.random() * 0.4 + 0.6
my.variables.colorG = math.random() * 0.3 + 0.3
my.variables.colorB = math.random() * 0.5 + 0.5
end
function onUpdate(dt)
rx = rx + (my.variables.rotSpeedX or 0.8) * dt
ry = ry + (my.variables.rotSpeedY or 1.2) * dt
end
function onDraw()
local r = my.variables.colorR or 0.8
local g = my.variables.colorG or 0.3
local b = my.variables.colorB or 0.8
local steps = 12
local radius = 0.42
for i = 1, steps do
local t = (i - 1) / (steps - 1)
local cx = -0.12 * t
local cy = -0.12 * t
local rad = radius * (1 - t * 0.5)
local factor = 0.35 + t * 0.65
castle.draw.setColor(r * factor, g * factor, b * factor)
castle.draw.circle("fill", cx, cy, rad)
end
castle.draw.setColor(r * 0.3, g * 0.3, b * 0.3, 0.45)
castle.draw.setLineWidth(0.015)