Genuary 2023 Day 19 - Black and White

January 19, 2023
pico-8 open-source
Genuary 2023 Day 19 - Black and White
-- genuary #19 2023
-- black and white
-- by carson kompon
pal({[0]=7,134,134,5,5,5,0,0,0,0,0,0,0,0,0,0},1)

splats={}
spin=0
dist=0

cls()
::_::
	
	for i=1,1400 do
		local x=rnd(128)
		local y=rnd(128)
		local c=max(pget(x,y)-1)
		circfill(x,y,0,c)
	end
	
	local x=63+cos(spin)*dist
	local y=63+sin(spin)*dist
	local spd=.2+rnd(.5)
	for i=1,10 do
		add(splats,{
			x=x,y=y,
			size=rnd(3),
			dir=rnd(),
			spd=spd,
			fric=spd/50+rnd(spd/8),
			shrink=.03+rnd(.1),
			power=1,
		})
	end
	
	for s in all(splats) do
		s.size-=s.shrink
		s.spd=max(s.spd-s.fric)
		s.x+=cos(s.dir)*s.spd
		s.y+=sin(s.dir)*s.spd
		local c=pget(s.x,s.y)+s.power
		circfill(s.x,s.y,s.size,min(c,10))
		if(s.size<=0)del(splats,s)
	end
	
	flip()
	spin+=16/(16*30)
	dist+=84/(8*30)
	if(dist>84)dist=0
goto _