Skip to content

About

Endless runner inside a pop-up book for iPhone Duo — fold the phone to flatten paper walls, open it to raise bridges. Bitrig Hacks: iPhone Duo Edition.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

17 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pop-Up Post

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).

Title card: Pop-Up Run — swipe to change lanes, fold to flatten red pop-ups, open to raise blue bridges The paper courier running down the book's spine with a parcel, pop-ups folded flat and glowing green

How it plays

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"]
Loading

iPhone Duo APIs used

  • View.onHingeChange → DeviceHingeContext.hinge?.angle / .status (continuous fold input; nil hinge 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)

Project layout

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

How we got here (three versions in one day)

  1. v1: The Last Delivery. Folding tilted a bridge: steep was fast, flat was a safe landing for a fragile cake.
  2. 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.
  3. 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.

Assets

All third-party assets are by Kenney, CC0 1.0 (public domain):

courier idle courier walk courier jump courier cheer courier fall

The paper textures (pages, fences, trains, bridges) are drawn in code with Core Graphics, and the app icon was generated from an SF Symbol.

Run it

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.

About

Endless runner inside a pop-up book for iPhone Duo — fold the phone to flatten paper walls, open it to raise bridges. Bitrig Hacks: iPhone Duo Edition.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages