Fly a rocket with your phone.
Open the game on a computer and scan the QR code: your phone becomes the controller. Tilt it to steer through a canyon that gets faster and narrower the further you fly. Play alone, or with two phones on one screen, and the best distances go on a leaderboard.
Tech stack
| Technology | Purpose |
|---|---|
| TanStack Start and React 19 | The screen, the phone controller and the server routes |
| Three.js | The canyon, the obstacles and the rocket in 3D |
| Durable Objects | One room per game: WebSockets between the screen and phones |
| D1 | The leaderboard |
| Cloudflare Workers | Serves the app and the WebSockets |
How it works
- The screen opens a room, a Durable Object, and shows its QR code.
- The phone scans it and joins the room over a WebSocket. Tap to launch: the way you hold the phone becomes straight ahead.
- The phone sends its tilt many times a second. With no motion sensor, you drag on a ring instead.
- The room passes each move to the screen, which flies the rocket. The canyon is generated from a seed, so both players fly the same one.
- When a rocket crashes, the room checks the distance and saves it to D1. The table is created on the first request: there are no migrations to run.
How to deploy Canyon Run to your Cloudflare account
Conic lets you deploy to Cloudflare like you deploy to Vercel. The difference: everything runs on your own Cloudflare account, so you keep its prices, its limits and its data.
- Choose Deploy now and connect your Cloudflare account.
- Conic builds Canyon Run straight from its repository, with nothing to fork, and creates the Worker and every resource it needs, such as Durable Objects and D1 databases.
- Your app is live on a workers.dev URL. Add your own domain in Domains whenever you want.
When the template gets a new version, your project’s Overview shows New version available. Nothing changes until you choose Update. Every deployment keeps its build logs and runtime logs, and you can roll back to an earlier one in one click. See everything Conic does and its pricing.
Run it locally
git clone https://github.com/P-Essonam/canyon-run.git
cd canyon-run
pnpm install
pnpm devCustomize it
| File | What to change |
|---|---|
src/game/canyon.ts | The canyon's shape, its speed and the obstacles |
src/game/engine.ts | The 3D scene: colors, lights, camera and rocket |
src/worker/room.ts | The room: players, start and end of a game |
src/worker/scores.ts | The leaderboard |
src/lib/i18n.ts | The texts, in English and French |
src/shared/site.ts | Your domain, for the canonical link and the share card |
