Inspiration
An orrery is a clockwork model of the solar system that you look down on from above. I wanted to make a VR game that felt like holding one on your lap: small enough for an airplane tray table, quick enough for a two-minute bus ride, and playable with nothing but your hand.
Orbits turned out to be a perfect match for hand tracking. The motion you already make to fling something (pinch, pull back, let go) is exactly the input a slingshot needs. Everything else in the game comes from real gravity, so I could build a deep puzzle game around a single gesture that needs no tutorial.
What it does
Pocket Orrery is a seated, hands-only puzzle game for Meta Quest. A miniature solar system sits on a brass-rimmed table half a metre in front of you. Pinch anywhere, pull back, and release to launch a planet from the dock. Your goal is to collect every golden star-mote using as few planets as possible.
- 12 handmade skies: gas giants, asteroid belts, twin suns, gravity slingshots, wormholes and orbiting moons
- Daily Orbit: a new puzzle every day, generated from the date so everyone gets the same sky
- Sky Builder: make your own puzzle and share it with a single link
- Mixed reality on your real table, or VR in deep space
- Each mote you collect plays a note of a pentatonic chord, so a clean orbit literally sounds right
How I built it
Pocket Orrery is a WebXR app built with three.js and the WebXR Hand Input API. It's hosted as static files on GitHub Pages, so it starts in seconds in the Meta Quest Browser with no install.
Physics
Each planet feels the pull of every star and gas giant:
$$ \vec{a} = \sum_i \frac{GM_i \, (\vec{r}_i - \vec{r})}{\left(|\vec{r}_i - \vec{r}|^2 + \varepsilon\right)^{3/2}} $$
where $\varepsilon$ is a tiny softening term that keeps close passes stable. I integrate this at a fixed $\Delta t = \tfrac{1}{240}\,\text{s}$ using semi-implicit (symplectic) Euler:
$$ \vec{v}{n+1} = \vec{v}_n + \vec{a}(\vec{r}_n)\,\Delta t, \qquad \vec{r}{n+1} = \vec{r}n + \vec{v}{n+1}\,\Delta t $$
Unlike plain Euler, this conserves orbital energy over long runs, so a planet in a stable orbit keeps circling instead of slowly spiralling out.
Aiming
The launch velocity is the pull vector from where you pinched, $\vec{p}_0$, to where your hand is now, $\vec{p}$:
$$ \vec{v}{\text{launch}} = k\,(\vec{p}_0 - \vec{p}), \qquad |\vec{v}{\text{launch}}| \le v_{\max} $$
About 10 cm of hand movement covers the full power range, so every shot fits inside a two-foot radius. The dotted trajectory preview runs the exact same deterministic simulation as the game. The prediction isn't an approximation: what you see is precisely what happens. That turns the game into a puzzle of judgement rather than a test of reflexes.
Levels that are guaranteed solvable
Instead of placing motes by hand and hoping, each level is built from a reference solution. I simulate a real launch and place the motes along its path. For example, a circular orbit at radius $r$ needs speed $v = \sqrt{GM/r}$, so the first level puts its motes on that circle. An automated test then proves that every level, and every generated Daily Orbit, can be solved within par.
Testing
I tested hand input end to end with Meta's Immersive Web Emulation Runtime (IWER), driving emulated hands that pinch, pull and release like a real player. The demo video is recorded from the same scripted run.
Challenges I ran into
- Release jitter. When you open your fingers to let go, the pinch point drifts a centimetre or two in the last moment, enough to ruin a carefully lined-up shot. The fix was to keep a short history of the aim and launch with the value from about 150 ms before the release began. Now the planet goes exactly where the preview showed.
- Making a puzzle out of chaos. Gravity with several bodies is chaotic, so tiny input changes can produce wildly different paths. The exact preview solved the fairness problem, and building levels from reference solutions made sure every puzzle actually has an answer.
- Designing for a seat. Every interaction had to pass the "airplane seat test": no standing, no reaching, and nothing outside arm's length. Even the buttons are flat tiles on the table, pressed with the same pinch, so there are no floating panels to point at.
- Testing without a headset in hand. Building against the emulator meant thinking carefully about where a hand really is. Emulated fingers converge off-centre when pinching, which taught me to never trust a single fingertip position.
What I learned
- Hand tracking rewards one great gesture over many small ones. Players never have to learn a control scheme.
- A deterministic simulation is a superpower: the same code drives gameplay, the aiming preview, level generation and automated tests.
- Small, seated, short-session design is its own craft. Fast cold start, satisfying in under ten minutes shaped every decision.
What's next
- A community gallery of player-made skies
- "Beat my par" challenges between friends
- A time-trial mode
- Anchoring the table to a detected real surface in mixed reality
- Publishing on the Meta Horizon Store
