your job is to BLOT OUT THE SUN with BALLOONS. hop to it, bucko

> controls

  • click and hold to inflate balloons (but don't overinflate!)
  • the balloon you're inflating is fragile -- don't let the others bump it!
  • restart: ctrl-R (or enter for pause menu)
  • mute: ctrl-M

> code

this game was made in 500 characters of code: (and no external sprites/sounds)

q={}u=unpack::_::w=0for i=1,#q do p=q[i]for l=1,2do
for k=i,#q do o=q[k]if((p[1]-o[1])^2+(p[2]-o[2])^2<(p[3]+o[3])^2)o.b*=-1p.b*=-1end end
if(g and g.b<0)❎,g=del(q,g)deli(z and q)?'⁷afd'
do if(g)g[2]-=1g[3]+=1if(btn()<1)g[5]=rnd(4)-2g[6],g=rnd(4)-2?'⁷i7ce',0,0
goto _

> some code highlights

  • use a loop to move and check wall-bouncing along each axis separately: for l=1,2do p[l]+=p[l+4]
  • p8scii balloon tails! ?'⧗ᶜ7⁵alし'
  • colliding toggles each balloon's bounce direction, and toggling twice is a no-op, so save 2 chars by making each balloon collide with itself every frame: for k=i,#q instead of for k=i+1,#q
  • possibly the worst line of code I've ever written? but hey, it makes the balloons pop: if(g and g.b<0)❎,g=del(q,g)deli(z and q)?'⁷afd'
  • squash two shorthand ifs and a shorthand print all on the same line by force of sheer hope; I believe the parser is basically just impressed at my audacity here. do if(g)...if(btn()<1)...?... <newline> end
    • this doesn't work without the do-end
    • this will likely not work in future versions of pico8
    • if this does work in the future, I suspect it could be used to break out of pico8's token limit? not sure; I haven't investigated yet


Log in with to leave a comment.

haha that was great fun! Can’t believe it’s all in 500 characters. 






wow i love this. high score 3142!!

this is cool!! i don't think i've ever played a game like this before.


great stuff, here's my high score so far: