Last year I shipped a browser game for Red Bull Spain. A Temple Run–style experience where you play as Nico Williams — the Barça winger who had arguably the best LaLiga season of his career in 2024–25 — dodging defenders, collecting coins, and grabbing Red Bull cans for a speed boost. It ran in the browser, had to work on mobile, needed to handle a leaderboard without cheating, and landed over 100,000 users.
This is what building it actually looked like.
What we were building
The brief was clear enough on paper: an interactive web activation to celebrate Nico Williams’ season. Users would play a short 45-second game, post their score to a leaderboard, and the top players would win something. Red Bull Spain had the marketing side covered — we had to build the thing.
The stack I landed on: Three.js for the 3D engine, React + Vite for the shell, Express + PostgreSQL on the backend, and Redis for session management and rate limiting. No game engine, no physics library. Just Three.js and a requestAnimationFrame loop.
Three.js on mobile is a different game
The biggest constraint from day one was mobile performance. A significant portion of the expected traffic would come from phones — people scanning a QR code at an event, sharing the link on Instagram. If the game ran at 30fps on a mid-range Android, it was broken.
Three.js gives you enough rope to hang yourself with. Shadows alone can tank a mobile GPU. So the first decisions weren’t about what to add, they were about what to cut:
- No shadows.
shadowMap.enabled = false. The biggest single win. - Pixel ratio capped at 1.5. On a Retina display rendering at 3× means 9× the fragments. 1.5 is a reasonable middle ground.
- No anti-aliasing. A hard trade-off. You notice it, but the frame budget matters more.
- Fog as implicit LOD. Objects fade into fog beyond 85 units, so you never render geometry the player can’t meaningfully see.
The character models — Nico, the defenders, the coin, the Red Bull can — are all GLB files animated with Three.js’s AnimationMixer. For enemies, we clone the skeleton with SkeletonUtils instead of re-parsing the GLTF on each spawn, which made a real difference once the lane was full.
Object pooling or: don’t let the garbage collector win
In a game loop running at 60fps, creating and destroying objects constantly is a good way to cause jank. Every time JavaScript’s garbage collector runs, you lose frames.
The solution is an object pool: pre-allocate a fixed set of obstacles and collectibles at startup, mark them active or inactive, and reuse them. Nothing gets created during gameplay, nothing gets destroyed. The pool allocator is maybe 40 lines of code and it’s one of the most impactful things in the project.
The lanes themselves work on a simple system: three positions (-1, 0, +1 on the X axis), with a minimum spacing of 8 units between spawns per lane. The world scrolls toward the player — the player stays roughly in place while everything moves. Classic conveyor belt trick.
The anti-cheat problem
A leaderboard with a prize attached is a leaderboard that will get cheated. This part of the project was more interesting than I expected.
The naive approach — send the score from the client, save it — lasts about five minutes before someone opens DevTools and posts { score: 999999 }. So we built a layered system.
Each game session starts with a server-issued UUID. The backend stores it in Redis with a 10-minute TTL. When the game ends, the client doesn’t send a score — it sends an encrypted payload of raw metrics: coins collected, collision count, streak, time spent with the speed boost active. The encryption uses AES-256-GCM, keyed from a hash of the session ID, a timestamp, and a server-side salt.
The server decrypts the payload, recalculates the score itself from those metrics, and ignores whatever number the client thought it had. If the decrypted metrics don’t add up — coins collected faster than physically possible, zero collisions with a perfect streak, inputs that don’t match the action count — the submission gets a risk score. High enough risk and the entry is hidden from the leaderboard silently. No error shown to the user. They see themselves ranked; they just never appear for others.
Redis also handles rate limiting: 5 score submissions per 60 seconds per IP. Enough for legitimate retries, not enough for scripted flooding.
Five rounds of changes
What I didn’t write in the code was the number of times the Red Bull team came back with new requirements. The kit Nico wears in the game changed at least five times. Sponsor logos on the stadium walls, timing of power-ups, how the leaderboard displayed — all of it went through multiple rounds while the deadline stayed fixed.
Working with a client like Red Bull is genuinely exciting. The brief matters, the quality bar is high, and seeing your work deployed at that scale is hard to replicate. It’s also exhausting in a way a personal project never is. Every change request lands with urgency. The pressure is real.
If this had been my own project I’d have taken longer with the game feel — the jump curve, how the camera lags behind lateral movement, the particle burst when you collect a coin. There were corners I knew I was cutting. You learn to accept that in client work. Shipped and imperfect beats perfect and late.
What I’d do differently
Honestly, not much on the architecture. The pooling, the encryption, the Redis session layer — those decisions aged well. Where I’d invest more time is in the feel. The small things: screen shake on collision, better audio timing, the satisfying weight of a character that actually feels like it’s running on a surface. That layer of polish is where browser games live or die, and it’s the first thing that gets cut when time is short.
The project hit over 100,000 users. The leaderboard held up. No major cheating incidents made it through. For a 45-second browser game built under pressure, that’s a good result.