ASCII Aquarium
Click anywhere in the tank to drop food — the fish will notice and dart over to eat it. Move your cursor through the water to spook them and watch the school scatter.
ASCII Aquarium is a tiny living ecosystem drawn entirely from text characters. Fish glide, turn, and dart across the tank on their own — schooling, chasing food, and scattering when startled — while bubbles rise and seaweed sways in the current. Nothing is scripted or pre-rendered: every frame is a little simulation deciding what each creature does next, one character at a time. I built it for the pure fun of it — a love letter to ASCII art and the strange magic of watching code come alive.
How It Works
Each fish is a tiny autonomous agent, not an animation. On every frame it picks a heading by priority — flee the cursor if it's close, else feed toward the nearest flake in range, else school behind its leader, else wander — then a boids-style separation force nudges it clear of its neighbours so the tank never clumps. Bubbles spawn in random bursts, seaweed cycles through sway frames, and dropped food sinks until a fish gets close enough to eat it. The whole loop is delta-time based, so it runs at the same speed on any display and survives a background tab without anything teleporting.
Highlights
- Emergent behaviour. Schooling, chasing, and scattering all fall out of a handful of simple per-fish rules — no scripted paths, no keyframes.
- Four species, one shoal. Different sizes, colours, and speeds, with the faster fish schooling behind leaders and the loners drifting on their own.
- You're part of the ecosystem. Your cursor reads as a predator and your clicks drop food — the tank reacts to you in real time.
- Built for smooth. Positions live in JavaScript state and the DOM is only ever written to — no layout reads in the hot loop — so the whole aquarium animates without jank.