local c64loading={}
local timer=0
local flickerinterval=0.040
local stripes={}
local rng=love.math.newRandomGenerator(os.time())
function c64loading.load()
for y=1,1080 do
stripes[y]={r=rng:random(),g=rng:random(),b=rng:random(),thickness=6*(0.5+rng:random()*0.5)}
end end
function c64loading.update(dt)
timer=timer+dt
if timer>=flickerinterval then
for y=1,1080 do
stripes[y].r=rng:random()
stripes[y].g=rng:random()
stripes[y].b=rng:random()
stripes[y].thickness=6*(0.5+rng:random()*0.5)
if rng:random()<0.5 then
stripes[y].thickness=stripes[y].thickness*2
end end
timer=0
end end
function c64loading.draw()
love.graphics.push()
local currenty=1
for y=1,1080 do
local c=stripes[y]
love.graphics.setColor(c.r,c.g,c.b,1)
love.graphics.rectangle("fill",0,currenty-1,1920,c.thickness)
currenty=currenty+c.thickness
if currenty>1080 then break end
end
love.graphics.pop()
end
return c64loading
