Blog · Xeve · How we built it · · 6 min read

How we built a Road Rash-style browser game with Claude Code

Road Rush is a 1990s-style motorbike brawler you can race with friends in a browser tab. How the road, the art and the phone controls came together with Claude Code.

Road Rush's Downtown Rush track from the rider's seat, with a rival throwing a punch and textured shop fronts on both sides

We built Road Rush by describing the game to Claude Code in one sentence and then playing every version it produced. It's a motorbike brawler in the style of the 1990s Road Rash games: you race through traffic, punch rivals off their bikes, outrun the cops and buy a faster bike with the prize money, all in a browser tab.

This is how it went from that sentence to a game we could play on a phone.

The brief was one sentence

The whole project started from this:

I want to build a multi player fun to play roadrash game the old game early 2000's can you build it? web based game will be good , full menu etc , selecting bikes and everyhing boosts

Five screenshots of the original game came with it: the street from the rider's seat, two menu screens, a character portrait and the bike shop.

Before any code, we settled the three choices that would shape everything else. Multiplayer would be real-time rooms joined with a four-letter code, with AI riders filling the empty grid slots. The graphics would be a pseudo-3D road drawn on a plain 2D canvas, the trick racing games used before 3D hardware. And the menus were in scope from day one, because the menus are half of what made those games feel the way they did.

The first playable version had five tracks, eight bikes and six riders, with a career mode, one-on-one duels and online rooms. It's about 3,900 lines of plain JavaScript, Python, CSS and HTML, with no framework and no build step.

A road made of slices

The road is a long list of short segments, each 200 world units long. Every frame, the game projects the next 130 or so onto the screen, nearest first. A curve is just a number that nudges each segment a little further sideways than the last. A hill is a height per segment. Scenery, traffic and rivals are drawn in a second pass from far to near, so they disappear behind a crest the way they should.

Everything renders at 640×400 and is scaled up with pixelated sampling, which gets you half of the period look for free.

The most useful decision was making the world deterministic. Every track is generated from a seed, so every player in a room gets the identical road. Traffic is a pure function of the race clock: a car's position is where it started plus its speed times the time. That meant there was no traffic to keep in sync between players at all.

Racing friends without a physics server

In an online race, each browser simulates its own bike and shares its state 15 times a second. The lobby keeps time, passes positions along and builds the results table from everyone's finish times. The player who opened the room also drives the AI riders, so everyone sees the same rivals.

That trusts every player to report honestly. For racing friends it was the right trade: it feels instant, and there was no prediction or rollback code to write.

The bug a simulation found

Early on, AI riders crashed into traffic constantly. Playing the game didn't explain it, so we had Claude Code run a headless simulation of all five tracks with a bot rider and count every crash and its cause.

The numbers pointed straight at the hitboxes. Car widths had been measured against half the road width, while positions used the full width, so every car was twice as wide as its picture. Fixing the unit, and teaching the AI to brake using its stopping distance instead of a fixed gap, turned a crash-fest into a race.

Making it look like the 1990s

The first version drew everything with vector shapes. It played well and looked like a tech demo. So came the second prompt:

i want it to look as close as possible to the original road rash, i think we have a [redacted] which u can use nanobanana and generate images if required

Image models don't produce transparency, so every sprite was generated on a flat magenta or lime-green backdrop and cut out by a script. The script fills inward from the edges, so a pink jacket survives a magenta key, and it also removes background showing through closed gaps such as a taxi's rear window. Each rider has a rest pose and a punch pose. The punch is an edit of the rest image that asks for the same rider and bike with one arm thrown out sideways, which kept the design consistent. The other side is the same frame mirrored.

Road Rush's coast track with palm trees, the sea on the left and four rivals ahead Coast Highway, with generated palms, signs, sea and sand textures.

Building fronts are single pictures cut into vertical slices along the roadside, more finely near the camera so the perspective doesn't step. Ground textures were made to tile seamlessly, and skies were blended at the edges so they scroll forever.

One lesson came from the references. The original game's screenshots went in as style references, and for the in-race art that worked well. For several menu backdrops, though, the model reproduced the reference almost exactly, including the original game's character and its on-screen text. We deleted every one of them and regenerated them without reference images, asking for no text, no interface and no brand names. One bike had come back with menu text baked in and another with a real manufacturer's name, so those were redone too. Every rider, bike and logo in the game is original.

The bike shop showing a red and white 900cc Samurai with its price, Cash+Trade total and stat bars The bike shop, with a generated garage backdrop and showroom render.

In all, 104 source images went into the game, for about $5 of image generation.

Then it met a phone

The first real-world test arrived as a screenshot from an iPhone held upright, with one line:

This happens in phone. Make it more phone optimized .

The game was a thin strip in the middle of a tall screen, the touch buttons covered the dashboard, and holding the gas button brought up the iOS Copy and Look Up menu.

Held upright, the game now sits at the top at full width, and a controller fills the space underneath where thumbs actually rest. Held sideways, the game fills the screen and the controls move into the black bars at the sides. Steering became a pad you slide your thumb across, so how far you are from the centre is how hard you turn. On touch screens the throttle is automatic, and Pause and Back buttons stand in for the Escape key a phone doesn't have.

The game in two phone-sized frames: upright with a controller under the race, and sideways with controls in the side bars Upright and sideways layouts on a phone-sized screen.

The best bug of that pass was a name. We marked upright phones with a portrait class on the page, but portrait was already the class of the rider-portrait picture in the menus. The whole page quietly took on that picture's size, position and purple glow. Renaming it fixed everything at once.

The takeaway

Start with the playable ugly version, and let real play decide what to fix next. The hitbox bug only showed up in a simulation, the copied menus only showed up when we looked at what came back, and the phone problems only showed up on a phone. You can race it at roadrush.xeve.io.