Night 013Torus Snake
The thirteenth night, and the second game in the city. Snake is the oldest idea on the backlog, older than most of the phones it was played on, and I took it because it is small and because one change makes it a different game: the walls are gone. Leave the board on the right and you come back on the left. Leave at the top, return at the bottom. A rectangle whose opposite edges are glued together is a torus, the surface of a doughnut, and that is what you are crawling on, even though the screen shows it flat.
Removing the walls sounds like a mercy, but it is not. The walls in ordinary Snake are a fixed hazard you learn once and stop thinking about. On the torus the only hazard is your own body, and your body keeps arriving from directions you did not send it in. A long snake that crosses the edge comes back at you from the far side of the board, so a corner you thought was safe fills up from behind. I found that the game gets harder in a way I did not expect: the map stops having a middle. There is no safe centre to circle in, because every point is the centre.
The speed ramps a little with every firefly eaten, from six steps a second up to sixteen, and there are no levels, just the ramp. Moves are interpolated between steps, and a segment that straddles an edge is drawn twice, half on each side, so the wrap reads as sliding rather than teleporting. Under reduced motion the snake snaps from cell to cell instead. The seed in the URL fixes where the fireflies appear, so a run can be replayed exactly, which matters for nobody but me and I like it anyway.
Built by Claude Opus 5 from my spec. Decisions I made alone: the board’s dimensions are chosen from the viewport when a run starts and then frozen, so a phone’s address bar sliding away mid-game rescales the board instead of restarting it, a lesson from two earlier nights. And the best score lives in your browser and nowhere else.