Does this code make sense? No, not really. But wow is this demo nice!
When it comes to fitting amazing creations into the smallest amount of code possible, I don’t think there are any better than Mathieu ‘p01’ Henri… And his most recent sketch, Night Train, is no exception.
NIGHT TRAIN
— Mathieu 'p01' Henri (@p01) December 22, 2019
A quick #pico8 #tweetjam
x=0::_::cls(13)srand()for i=0,44 do
z=64+3*sin(i/45)y=z+cos(i/2)*(9+z*z%61)x-=3
?"ˇ",x,rnd(128),6
u=x+2*sin(x/31)
for j=-9,rnd(4)+7 do line(u,y-9,x+j,y+4+i%9,1+flr(y%2)*5)end
?"=",x,z,1
if(sin(x/84)>.8)print("😐",x,z-2)
x%=134end
flip()goto _ pic.twitter.com/ZQboc8Iet6
The scene, featuring a train rolling through a generative field dotted with grass and some windy trees, is really a mind blower… Especially considering the formula generating it consists of 242 characters, fitting inside the tweet!
For real though, what is that emoji doing in there?
Of course, there’s a little more running behind the scenes. The demo is built to run on the PICO8, a tiny “fantasy console” designed to mimic a real console, without any of the actual hardware.
Honestly, the console looks great for those who are looking to get into creative coding, but want to limit their scope to the beautiful and quirky old school looks. You can start digging into the PICO8 world here.
pl,m={1,2,4,8,10,7},cos
— eugör (@egordorichev) May 16, 2019
::★::
cls()o=t()for x=0,127,6 do
for z=0,127,6 do
y=z+x/6%2*3
c,v=y-64,x-64
d=sqrt(c*c+v*v)c=4+3*m(((atan2(v,c)*m(d/128+o*0.3423))*4+d/12)*0.3+o*((0.3+m(t()*0.1)*0.7)*0.5))circfill(x,y,min(2,c*0.5),pl[flr(c*0.9)])end
end
flip()goto ★--#tweetjam #pico8 pic.twitter.com/QmLP0EAyrI
Following the hashtags on the tweets, you can see there’re a whole lot of amazing PICO8 developers out there creating some really neat stuff. Definitely check them out if you’re looking for some inspiration.
I was lucky enough to see Mathieu present at Front Trends in 2017, where he talked about some of his amazing demos, as well as “tiny javascript” (something I like to cover often on this blog under the tag microcode). It was both educational and really, really impressive.
If you’ve got a spare 30 minutes, I really recommend checking it out!
➶ Night Train
➶ Mathieu Henri
➶ Mathieu Henri on Twitter
➶ PICO8