Chain Reaction game in less than 1000 characters for #Pico1k Jam. No predefined assets are used.

Source code:

_set_fps(60)f=128t={5,2,10,3,15,5,20,8,25,10,30,16,40,30,50,40}l=2::s::k=.5z=-1x=64y=64e=1o={}n=t[l-1]m=t[l]for i=1,n do
a=rnd()add(o,{x=rnd(f),y=rnd(f),u=k*cos(a),v=k*sin(a),r=0,c=4+rnd(12)})end::_::cls(1)pal(5,3)c=0d=0z+=.01
if e>0and z>0then
b=btn()x+=(b&2)/2-(b&1)y+=(b&8)/8-(b&4)/4x=mid(x,127)y=mid(y,127)
if(btnp(4))e-=1add(o,{x=x,y=y,u=0,v=0,r=k,c=2})
?"+",x-1,y-2,9
end
for i=#o,1,-1do
p=o[i]p.x+=p.u
p.y+=p.v
if(p.x<0)p.x,p.u=-p.x,abs(p.u)
if(p.y<0)p.y,p.v=-p.y,abs(p.v)
if(p.x>=f)p.x,p.u=2*f-p.x,-abs(p.u)
if(p.y>=f)p.y,p.v=2*f-p.y,-abs(p.v)
if(p.r==0)pset(p.x,p.y,p.c)c+=1
if p.r>0then
d+=1p.r+=k
r=min(15,min(p.r,50-p.r))circfill(p.x,p.y,r,p.c)w=k*r
for j=1,#o do
q=o[j]
if q.r==0then
a=k*(p.x-q.x)b=k*(p.y-q.y)
if(a*a+b*b<=w*w)q.r=k q.u=0q.v=0?"\as4f1edcba"
end
end
if(r<k)p.r=-1
end
end
if(d<1and c<=n-m)l=(l+1)%#t+1goto s
if(d<1and e<1)goto s
if(z<0)?"chain reaction\n\n\nlvl "..(l/2).."\n\ntarget "..m.."/"..n,40,40,10
?"l:"..(l\2).." "..m.."/"..n.." d:"..n-c,1,1,7
flip()goto _


Comments

Log in with itch.io to leave a comment.

This is clever. 

I also got stuck on lvl 7.

Brilliant! ๐Ÿ‘
Fun & just the right level of difficulty (I got stuck on Lvl 7 for ages, but was determined to complete it!)
Love how addictive these type of games can be! ๐Ÿ˜…

You actually just reminded me that I made a similar clone for a previous PICO-8 jam - I demade "Boomshine" (got the original dev's blessing beforehand). ๐Ÿค“

(+1)

Thanks! You would not believe, but I made up some quick numbers for particle count and chaining target for each lvl and found them mostly ok. Tuning difficulty was just a matter of choosing the maximum radius and the amount of frames a circle would stay in that maximum radius. I completed it twice to check it was ok. I was afraid it was too easy. Now I realize lvl 7 is the most difficult lvl. After that lvl is easy to sustain a big chain reaction due to the high number of particles in screen.

Btw, your game is great. You always get a level of playability and polishment that is impossible for us mortals ๐Ÿ˜