a first-person 3D maze treasure hunt rendered over WebGL — written entirely in bash
▶ Play MIMEcroft.sh in the browser shell
opens the shell at www/index.html and auto-starts the game via the
allow-listed ?demo=MIMEcroft.sh parameter (see SECURITY.md) — the
game boots as the MIMEcroft command (the script is bin/MIMEcroft.sh). You can also just
open the shell and type MIMEcroft.sh (or mimecroft.sh).
You are the shell command Mime Croft on the hunt for hidden treasures inside an ancient yet sacred filesystem on Phobos. The maze around you is made of
data blocks — coloured chunks of file content. Somewhere in the depths lie hidden
treasures: the Great Operating Systems (GNU Hurd, Linux, FreeBSD, NetBSD, OpenBSD, Plan 9, Minix,
Solaris, macOS Darwin, Unix) preserved as artifacts. But the filesystem is infested with
evil MIMEs — misbehaving content types (image/jpeg, image/png,
application/octet-stream, text/plain) that hunt you through the corridors.
Your gun fires a single ray of pure type-checking. Shooting a block mines through the data; shooting a MIME sanitises it. Walk into a hidden treasure to recover it — shooting one shatters the artifact and costs you an archaeology-licence strike (three strikes and the Board revokes it).
WASD move · ←/→ turn · SPACE shoot · Q quit · ESC settings
The settings menu tweaks the camera shift, texture size/seed, CRT & corruption effects, the minimap, mime speed and the sound mode (notes oscillators or bash — sample-accurate generators).
bin/MIMEcroft.sh, ~3,900 lines) that runs in the
browser via the shell's bash→JS transpiler — no build step, no WebGL API calls in the game itself./dev/webgl and
plays by writing samples to /dev/audio — the Plan 9-style filesystem-as-API metaphor
(see bash-game-vision.md and
mimecroft-proposal.md).MIMEcroft command (the lowercase
bin/mimecroft.sh alias still works). One script does everything:/dev/webgl/blocks in one batched payload per frame; a continuous frustum
culls off-screen cells; floor/ceiling planes follow the camera/dev/webgl/texture, and plays sounds through /dev/audiobc), and the fake perspective
(gl_Position = (rel×0.45, w²/64, w)). Compiled at startup by sh2glsl --vertex
into GLSL ES 1.00; the compiled reference is
examples/mimecroft-vertex.glsl.precision mediump int. Compiled by sh2glsl; the compiled reference
is examples/mimecroft-frag.glsl.$RANDOM), deterministic per seed. README.
The core texture-lib.sh is inlined into each generator so they run identically under host bash,
the real-bash wasm, and the transpiled shell:/dev/audio/samples in the
game's bash sound mode. README:The page's bash→JS transpiler turns MIMEcroft.sh into JavaScript against the sh2 runtime;
the /dev/webgl device (src/fs/webgldev.js) provides the WebGL context as files
(shader/, buffer/, uniform/, call, blocks),
and /dev/audio plays the notes or sample lists. The same script runs headless in the Node CLI
(a null WebGL device), which is how the game is regression-tested.
MIMEcroft lives in the j.cmd repo — the game, its shaders, textures and sounds, all written in bash.