leonardoaguiar.com

Topology Snake

The same snake. Eight shapes of space.

Snake with the rules you know: eat, grow, do not bite yourself. What changes is the space. Glue the edges of the board and it becomes a tube, a Möbius strip, a donut, a Klein bottle; then comes a planet, and at the end a universe that closes on itself, flown from inside. Eight worlds, each drawn in 3D as the shape it really is, all in your browser.

  • Web
  • Free
  • Private
Six worlds of Topology Snake: the green snake on a Möbius strip, on a donut, on a Klein bottle, on Boy's surface and on a sphere, and the pink apple seen from inside the hypersphere
  • 8 spaces for one snake
  • 5 apples to clear a world
  • 4 dimensions behind the last world
  • 0 bytes sent to a server

The rules stay. The space changes.

The first world is the board everyone knows, with a wall around it. Each world after that glues some of its edges together and draws what the gluing makes: a tube, a strip with one side, a donut, a bottle with no inside. Play walks them in order, five apples each, and the row above the game opens any world at any time.

Shapes drawn for real

The snake lives in the skin of a 3D shape, drawn in WebGL, and the camera rides with its head. When the shape gets in the way, the camera moves to where the head can be seen, and X-ray shows the rest of the snake through the surface.

Edges that bring you back flipped

One lap of the Möbius strip brings you back upside down. On the Klein bottle and the projective plane an edge returns you mirrored. The arrow keys always mean what they mean on screen, so a mirrored world never mirrors your hands.

A flat map with the glue marked

Beside the game the same board lies flat, with its edges drawn the way a topologist draws them: one arrow or two on each glued pair, pointing opposite ways where the glue has a flip, and walls in red. It shows where every edge leads, and where the apple is when the shape hides it.

A planet, then a universe

World seven is a sphere: no edge anywhere, and going straight brings you home. World eight is the hypersphere, the same idea one dimension up. You fly inside a finite space with no wall, things shrink with distance until halfway around and then grow again, and an apple at the far point of the universe fills the whole sky.

Autopilot, three speeds and a pause

Autopilot lets the snake play by itself in any world, to watch how a space works before you try it; its apples do not count. Slow, normal or fast, Space to pause, a drag to look around the shape, and full screen to make it big.

Keyboard, swipe or pad

The arrow keys or W, A, S and D. On a phone, swipe on the game or tap the pad beside the map. In the hypersphere, hold a key or drag on the sky to steer while the snake flies on by itself, and Q and E roll.

The game runs in your browser, and your progress stays there.

Every world is built and drawn on your machine, by your graphics card through WebGL. The game keeps one small note in this browser's storage: the worlds you have cleared, your best run in each, the speed and whether X-ray is on. Nothing is sent anywhere, and there is no account and no leaderboard.

  • The whole game runs in your browser
  • Progress is kept on this device only
  • No account, no upload, no leaderboard

Requirements

Runs in
A recent browser with WebGL, on a computer, a tablet or a phone
Controls
The arrow keys or W, A, S and D; on a touch screen, a swipe or the pad beside the map
Downloads
About 125 KB with the page; every world is built on the spot
Account
Not needed
Price
Free

Questions

How do I play?

Press Play and steer with the arrow keys, or with W, A, S and D; on a phone, swipe on the game or use the pad. The snake never stops. Eat the apple to grow, and do not run into a wall or into your own body. Five apples clear a world and open the next one.

What does gluing the edges mean?

Tape the left edge of a sheet of paper to its right edge and you get a tube: a snake that leaves the board on the left comes back on the right, because the two edges are now one. Tape both pairs and the sheet is the skin of a donut. Give the tape a half twist first and you get a Möbius strip, or, with both pairs, shapes that cannot be built in our space without passing through themselves.

Why did I come back on the other side of the map?

You crossed an edge glued with a flip. On the Möbius strip, the Klein bottle and the projective plane, the snake leaves at one end of such an edge and comes in at the opposite end of its partner, mirrored against the flat map. On screen nothing changes hands: the arrows keep following what you see.

The Klein bottle passes through itself. Can the snake cross there?

No. The crossing is only in the drawing: a Klein bottle needs four dimensions to exist without touching itself, and fitting it into three makes its neck pass through its side. For the snake there is only the surface it is on. The same goes for the projective plane, drawn here as Boy's surface.

What is the hypersphere?

A sphere's surface, one dimension up: a space with volume that is finite and has no wall. You fly inside it and steer while the snake advances by itself. Go straight and you return to where you started. Far things look smaller until halfway around the universe and bigger after that, and an apple at the exact opposite point covers the whole sky; an arrow at the rim of the screen and a radar point to it.

The shape hides the snake. What can I do?

The camera moves by itself to keep the head in view, and X-ray draws the snake through the shape when something is in front of it. You can also drag to look around, and Reset view puts the camera back. The flat map always shows the whole board.

Is my progress kept anywhere?

Only in this browser's storage: the worlds you cleared, your best run in each and two settings. Nothing is sent anywhere, and clearing the site's data removes it.

Privacy · Terms of Service