Pit Lane
A hidden game living inside this portfolio.
Every page on this site has a hidden entry point.
The signature in the top-left corner is clickable. Always has been. Click it on any page and you land here — a pixel-art Formula racing game built into the portfolio. No instructions needed. Arrow keys to steer, avoid the cones and rival cars, survive as long as you can. Speed increases the longer you last.
Play it here
Or find it anytime by clicking the signature in the top-left corner of any page.
How It Was Built
01
Canvas API & Game Loop
The entire game renders to a 320×480 logical canvas using the browser's Canvas 2D API — no game engine, no library. A requestAnimationFrame loop drives every frame, computing delta time between frames and capping it at 100ms to prevent physics explosions after tab switching. All game state lives in useRef values rather than React state so updates never trigger re-renders during the loop.
02
Pixel Art Drawing Routines
Every visual element — the player car, rival cars, traffic cones, road surface, dashes, and lane guides — is drawn with fillRect calls on each frame. The player car is a hand-designed Formula silhouette with a front wing, nose, side pods, cockpit, and rear wing built from a sequence of colored rectangles at specific offsets. No sprites, no images — pure procedural pixel art in code.
03
Physics & Collision
Speed ramps from 120 pixels per second at the start to a cap of 420 px/s over roughly 37 seconds — creating a difficulty curve that starts approachable and becomes genuinely hard. Obstacle spawn intervals tighten with time. Collision uses axis-aligned bounding box overlap with a slightly inset hitbox on the player car for fairness. Obstacles are culled when they scroll off the bottom of the canvas.
04
Touch Support & Design Tokens
On-screen left and right buttons appear automatically on touch devices, detected via a matchMedia hover query. The buttons use the same touch event handling as the keyboard input — adding and removing entries from a shared keys ref — so the game loop code is identical for both input methods. The canvas reads the site's Syne and Inter font CSS variables directly so the HUD and overlays match the rest of the portfolio.
Stack