Inspiration
Most "non-Euclidean" games use curved space as a visual trick. I wanted the curvature to be the core mechanic. In curved space, walking around a loop and coming back to where you started still turns you: that's called holonomy. We wanted players to feel that with their hands, by tilting a real controller rather than pressing keys. Perspective puzzles in The Witness and Superliminal inspired the 4D side of the game.
What it does
Phase Escape is a chase through a maze built on the hyperbolic plane, a space that curves the opposite way to a sphere. It's drawn in the Poincaré disk, where rooms crowd toward the edge because space grows exponentially.
The maze also has a fourth dimension: five layers, each with its own colour. Doors only open in their own colour, shards can only be collected in theirs, and hunters can only see and hurt you when you share their colour. You change layer by twisting the controller like a dial. You can also let space itself do it: roll once around a pillar and you come back one colour over. The four rooms around a pillar form a square with 72° corners instead of 90°, so a lap turns you 360° + 72°, which is exactly one of the five layers. One level jams twisting entirely, and loops are the only way through.
The tesseract in the corner is your view into 4D. Rifts block some passages, with a four-dimensional plank floating over each one. All you see is the plank's smeared shadow until you rotate your view through 4D, and then it lies flat and becomes a bridge.
There are 9 levels, plus tutorial tips, high scores, and music where every layer has its own chord.
How we built it
Game: TypeScript and Three.js in the browser, packaged as a Windows desktop app with Electron. Geometry: done exactly in the hyperboloid model (3×3 Lorentz matrices in 64-bit floats) and rendered with GPU instancing at 60 FPS. Controller: an ESP32 with a BNO055 orientation sensor on four AA batteries, streaming tilt and rotation at 100 Hz over Bluetooth Low Energy, or over USB. How the code got written: we built it with Claude Code, directing the design, testing every change, and pushing back when something felt wrong to play. Fairness checks: a solver proves every level can be finished, and an autopilot plays every level start to finish with the real physics. In total there are 143 automated tests. Claude code the G.O.A.T.
Challenges we ran into
Coming in without much coding experience. I used Claude code describing exactly what I wanted, reading what it produced, and using tests to catch its mistakes. Making curved-space math fair. Measuring the marble's wobbly path gave inconsistent results, so we carry your orientation room-centre to room-centre instead. That makes every pillar lap exactly 72°. Hardware. The sensor sometimes failed on first start-up until we added a clock-settle delay. Bluetooth on Windows failed silently on slow first searches until we added a "searching…" indicator, a timeout and a retry. My first design was too abstract. Players found tesseract-matching vague, so I rebuilt the game around a chase, with hunters, lives and a timer.
Accomplishments that we're proud of
It works: a real wireless controller drives a game in genuinely curved space at 60 FPS. The geometry is exact, not faked. The 72° per lap comes straight from the math, and the game explains it with a picture. Every level is proven solvable by the computer. Players learn holonomy by doing it, not by reading about it.
What we learned
How to run Bluetooth Low Energy on an ESP32 and connect to it from a browser. How hyperbolic geometry works, what holonomy is, and why rotations in 4D happen in planes rather than around axes. How to build software with an AI as a teammate: plan carefully, test everything, and check the output yourself.
What's next for Phase Escape
Support standard gamepads, so anyone can play without our custom controller. Publish it properly: host it on GitHub Pages so it runs in any Chrome or Edge browser, and release the desktop app. An endless mode using the level generator, a battery-level readout on the controller, and more levels.
Built With
- claude
- esp32
- imu
- typescript

Log in or sign up for Devpost to join the conversation.