An endless runner inside a pop-up book, built for iPhone Duo. Fold the phone to flatten paper walls; open it flat to raise bridges over gaps. The hinge is the controller.
Built for Bitrig Hacks: iPhone Duo Edition (SwiftUI + RealityKit, iOS 27.1 SDK).
| Input | In the book |
|---|---|
| Fold the phone (toward ~115°) | Pop-ups lie down: red fences and tall paper trains fold flat so the courier runs over them |
| Open it flat (180°) | Pop-ups stand up: blue paper bridges rise over holes in the page |
| Swipe left / right | Change lane (3 lanes either side of the spine) |
| Close the phone | Page turn: the run pauses and the outer display shows the book's cover |
Pop-ups turn green when your current fold lets the courier through, so you can read the danger before you reach it.
flowchart LR
H["Hinge angle (onHingeChange)"] --> S["Smoothed angle"]
S --> F["fold = (180° − angle) / (180° − 115°)"]
F --> P["pop-up height = 1 − fold"]
P --> C{"passable?"}
C -- "fence: h ≤ 0.55<br/>train: h ≤ 0.2<br/>bridge: h ≥ 0.7" --> OK["run on"]
C -- otherwise --> X["crash, 1-tap retry"]
View.onHingeChange→DeviceHingeContext.hinge?.angle/.status(continuous fold input;nilhinge falls back to an on-screen slider)- Outer display (closed, compact width) vs inner display (open) for pause / cover / resume
- Size classes +
GeometryProxy.reservedRegions(kind: .division)for layout around the fold, per Apple's guidance (hinge angle for interaction only)
| Path | What |
|---|---|
App/Runner/ |
Pop-Up Post: pure rules (RunnerRules.swift), model, RealityKit pop-up book (View/PopupBookWorld.swift), code-drawn paper art (View/PaperArt.swift) |
App/Game, App/World, App/UI |
Earlier versions (The Last Delivery), still in the app behind the -legacyGame YES launch argument |
Tools/runner_sim.swift |
Headless simulator + autopilot "contract" that checks every run is beatable at human hinge speed |
docs/ |
Design docs: v3 vision, v1/v2 design, research notes |
- v1: The Last Delivery. Folding tilted a bridge: steep was fast, flat was a safe landing for a fragile cake.
- v2. A 4-bridge route with jumps, cargo types (eggs / anvil / balloon), and closing the phone in a stairwell to tunnel through the outer display, all in a 3D RealityKit city.
- v3: Pop-Up Post. Playtesting v2 showed the hinge was an abstract throttle (the screen and the bridge tilted at the same time) and half-open was always the best move. We rebuilt around an object people already know how to fold: a pop-up book.
All third-party assets are by Kenney, CC0 1.0 (public domain):
- 3D courier: Mini Characters. Buildings: City Kit Commercial. Converted GLB → USDZ with Blender (
Tools/convert_models.py). SeeApp/Resources/Models/MODEL_CREDITS.txt. - Sound effects: Interface Sounds, Impact Sounds, Music Jingles. See
App/Resources/Sounds/CREDITS.txt. - 2D courier sprites (v1):
App/Resources/Sprites/
The paper textures (pages, fences, trains, bridges) are drawn in code with Core Graphics, and the app icon was generated from an SF Symbol.
Open in Bitrig or Xcode 27.1+, then run on the iPhone Duo simulator. In the simulator, use the Device Hub pose buttons and hold ⌥ to get the hinge-angle slider.

