City in a Bottle

Created by Frank Force (JS Gamedev Summit 2023 speaker, minimal Bytebeat album author, and LittleJS Game Jam organizer among many other things), City in a Bottle is a tiny raycasting engine and city generator that fits in a standalone 256 byte html file.

This is the FULL source code:

<canvas style=width:99% id=c onclick=setInterval('for(c.width=w=99,++t,i=6e3;i--;c.getContext`2d`.fillRect(i%w,i/w|0,1-d*Z/w+s,1))for(a=i%w/50-1,s=b=1-i/4e3,X=t,Y=Z=d=1;++Z<w&(Y<6-(32<Z&27<X%w&&X/9^Z/8)*8%46||d|(s=(X&Y&Z)%3/Z,a=b=1,d=Z/w));Y-=b)X+=a',t=9)>

You can read the Making Of blog post from the author himself and see it in action in this tweet. There’s also a HD version you can view on Shadertoy.

No Comments

Leave a Reply

Gamedev.js Shop
Gamedev.js Jam 2024
Gamedev.js Survey 2023 Report
Gamedev.js Discord

Follow us

Gamedev.js Weekly newsletter

Or visit directly.

Websites worth visiting

Log in

Forgot password?

Already registered? Log in


Forgot password?