Dr. Zerg
A multiplayer falling-capsule puzzle game, made so my friends in California and I could keep playing together.

My friends in California and I used to play Dr. Mario online on the Switch while talking on the phone. When the lag got too bad to play, I built our own version.
It has grown well past the original idea. You can play alone, against computer opponents, with up to four people on one screen, online, or with a mix of couch and online players in the same match. It supports game controllers, has voice and text chat, and works on a laptop or an iPad (and, technically, on a phone). A lot of that came from requests. One friend wanted to play from an iPad on a work break, with a controller, mixing people on the couch with people online. I wanted to be able to speed up falling garbage, which the original never let you do.
A few decisions I’m happy with
- No lag, by design. Each player's game runs entirely in their own browser, and the server only passes updates between players. Network delay changes when you see the others' boards, never how your own game responds. That was the reason for building it in the first place.
- Couch and online in the same match. People sharing a screen join an online room as players of their own, each with their own controller, so a group on a couch can play against friends in another country.
- Computer players shared out fairly. In online rooms, the CPU opponents run in the players' own browsers. Each round they're handed out evenly, to whoever is running the fewest, and a screen with couch guests already counts as busier. The server never runs a game itself, so it all fits on Cloudflare's free plan.
- A computer opponent that feels human. It varies its reaction time, sometimes hesitates on the easier levels, builds up chains to attack with, and switches to survival mode when its stack gets too high.
- Connection trouble pauses everyone. If someone's connection drops for a couple of seconds, every board pauses, so nobody loses unfairly, and there's a grace period to reconnect.
- Voice goes direct. Voice chat connects players straight to each other, so the audio never passes through the server.
- Small guards against mistakes. The “Back to lobby” button isn't preselected after a round, so a stray button press can't end the match for everyone. Typing in the chat is switched off while anyone is playing.
Music and sound are generated in code. The online rooms run on Cloudflare in eastern North America, roughly halfway between Norway and California. The game logic is unit tested, and a browser test plays a real online match, including a player dropping out mid-game.
Next: BeepKeep