Skip to content
Product engineering

An Endless Runner Leaderboard That Checks Every Score

An endless orb-runner for the browser with five worlds, synthesised nature soundscapes and offline play, backed by a shared leaderboard that recomputes every score on the server and rejects runs that could not have happened.

3 min read0 comments
Website

Why it was needed

Browser runner games are easy to start and easy to cheat. A public leaderboard that trusts the score a page sends fills with impossible numbers, while a game that needs an account or a network connection before it plays loses players before the first jump.

The game has to start instantly with no account, play offline once installed, and keep working when browser storage is unavailable. Every score a page submits is untrusted, so the server must judge each run without replaying it. Controls have to work with a keyboard, a mouse and two thumbs on a phone, including holding a slide while jumping. Five worlds need their own sound without shipping audio files that would slow the first load. Saves from the game's earlier name had to survive the rename to Orbline.

How it is built

A TanStack Start app renders the game UI in React around a full-screen canvas engine, and TanStack Start server functions run the leaderboard against PostgreSQL through Drizzle.

Recompute and bound every score on the server. The server ignores the client's score, recomputes it from distance and crystals, and rejects any distance or crystal count that the game's own speed rules could not reach in the time the server measured.

Synthesise sound instead of shipping files. Each soundscape is a small recipe of noise filters, so all five worlds sound different without adding audio downloads.

Play first, never sign up. Progress, orbs and settings live in guarded localStorage, and a leaderboard name is the only thing a player registers, kept as a hashed token rather than an account.

Use the same database in development and production. Without a database URL in development, the app runs PGlite, PostgreSQL compiled to WebAssembly, and migrates it automatically, so local runs use the same queries as production PostgreSQL.

The key decision: Recompute and bound every score on the server.

What changed

Designed the game loop, five worlds with four stages each, four unlockable orbs, three power-ups (Frost Ward, Crystal Lure and Aurora Rush), achievements and daily challenges. Built the canvas engine for movement, double jumps, slides, fast-falls, collisions, particles and parallax scenery. Wrote the procedural nature soundscapes and kept sound working on iPhone. Built the shared leaderboard with run tickets, server-side score checks, per-IP rate limits, case-insensitive unique names and an audit trail of rejected runs. Designed a consistent arcade UI with touch controls on every device, and shipped it as an installable PWA on Netlify.

The game opens straight to a playable title screen, and the installed app plays offline. Five worlds, each with four stages and its own synthesised soundscape, ship without a single audio file. The leaderboard never stores a score the client calculated, and rejected runs keep the reason they failed. Nine automated tests cover the anti-cheat limits, score formula and name rules. Known limit: a scripted client can still submit plausible numbers within the bounds, which would need server-side replay of recorded inputs to close.

My role: Game designer and full-stack engineer. Scope: Game design, canvas game engine, procedural audio, game UI, leaderboard API and anti-cheat, PWA and deployment.

Working through a similar challenge?

Share your context, constraints, and timeline to start a focused conversation.