press and hold the circle button to dissolve the city
Tweetcart Sourcecode (266 Characters):
poke(β|β€,μ/β)memset(81-π,170,8)s=β-μ
pal({0,0,-15,1,-4,12,13,12,-4,1,-15,1,-4,1,-15},1)pal({-15,1,-4,1,-15,1,-4,12,13,12,-4,1,-15,0,0},2)cls()r=rnd::_::
x=r(128)y=r(16)+56pset(x,y,r(16))d=r(8191)poke(s+d-tonum(btn(4))0.5,@(s+d-64(mid(1,(r()-.5)/0)*2-1)))
goto _
Explanation:
-- instruct the pico8 to use the second palette, for the top half of the screen only poke(β|β€,μ/β) memset(81-π,170,8)
-- save space by encoding the memory address for the display s=β-μ
-- set both palette one and two pal({0,0,-15,1,-4,12,13,12,-4,1,-15,1,-4,1,-15},1) pal({-15,1,-4,1,-15,1,-4,12,13,12,-4,1,-15,0,0},2)
-- clear the screen cls()
-- save characters when calling rnd r=rnd
-- mark the start of the draw loop ::_::
-- random position for x x=r(128) -- random position for y within narrow band y=r(16)+56 -- draw pixel of random color at that position pset(x,y,r(16))
-- choose a position in the display memory d=r(8191)
-- the part that makes the "city"
poke(
s+d-tonum(btn(4))0.5, -- write to this position, if the button is pressed shift by -0.5
@(s+d-64(mid(1,(r()-.5)/0)*2-1)) -- peek @ this position, last part is to get 1 or -1
)
goto _