Anass Kartit
← Writing / / 11 min read / Updated

Claude Sonnet 5.5 Built a Kart Racer for My TV: 4 Players, Gamepads

Turbo Kartz: a split-screen kart racer built in Claude Code. 4 tracks, jumps, gamepads on a Sony TV and in the browser. Every prompt inside.

claude sonnet 5.5claude opus 5.5kart racersplit screen gamegamepad browser gameandroid tv gamethree.js gameclaude codevibe coding2026

Turbo Kartz is a cartoon kart racer for 1 to 4 players that I built in Claude Code. Claude Sonnet 5.5 built the game in 12 prompts; Claude Opus 5.5 then turned it into something people actually play on a TV, in 8 more. It has 4 tracks, jump ramps with tricks, an EASY mode with smart steering, and split screen with real gamepads, on my Sony BRAVIA and in any browser on a Mac or Windows PC. This post lists every prompt, the bugs that only showed up when someone played it, and the code worth copying.

Play Turbo Kartz ↗All the prompts ↗

Key facts (quick answer)

FactValue
GameTurbo Kartz, a three.js kart racer that plays in the browser
Built withClaude Sonnet 5.5 (game, 12 prompts), Claude Opus 5.5 (TV upgrade, 8 prompts), in Claude Code
Players1 vs 3 bots, or 2 to 4 in split screen
Controlsgamepads (Xbox, PlayStation, Switch Pro), TV remote, keyboard, touch
Tracks4: Sunny Meadow (837 m), Candy Canyon (1,056 m), Snowy Peaks (1,057 m), Beach Bay (1,115 m)
ModesEASY (smart steering), MANUAL, KIDS (drives itself)
Android TV app5.2 MB with music, tested on a Sony BRAVIA (Android 12, Google TV)
Music and soundLyria 3 Pro, $0.08 per call, $0.40 logged
Track artCodex image generation from screenshots of the game
Sonnet 5.5 price$2 / $10 per 1M tokens (Opus 5.5: $4 / $20)

TL;DR

  • The road was invisible. It was built facing down, so the TV skipped drawing it and the track looked like one green field. One line made it grey, and most “I keep hitting the walls” complaints stopped.
  • EASY mode: 0 wall hits in 20 seconds of gas with no steering, against 7 in MANUAL.
  • Roads 60% wider: 15 m to 24 m; no corner tighter than a 17 m radius.
  • Gamepads everywhere: two Switch Pro Controllers on the TV; any standard gamepad in Chrome, Edge, Safari or Firefox.
  • Jumps: 2 or 3 ramps per lap, 1.0 to 1.7 s in the air; press any button in the air for a trick boost.
  • Sonnet 5.5 costs half of Opus 5.5 and beats it on 1 of 8 benchmarks (Terminal-Bench 4.0).

Turbo Kartz: four cartoon racers on the starting grid under a checkered arch

What did I ask? The 20 prompts

I fixed typos and trimmed a few for length. The full list, with the music and art prompts, is on the prompts page.

Part 1, the game, with Claude Sonnet 5.5:

  1. Create a 3D animation using HyperFrames and Three.js for a cartoon kart racing intro, a game motion graphics trailer.
  2. Make it a 2.5D cartoon, 3D-ish game.
  3. It needs improvement on the hands holding the wheel.
  4. Also add a fully playable stage demo.
  5. You can do better in terms of graphics. We need chunky, colourful cartoon characters.
  6. We need a way to turn this into a game ready for Android.
  7. Car selector with powers.
  8. Fix the stadium collisions, and the arrival.
  9. The Blaze character has only one eye. Kinda scary.
  10. Adapt the game to the D-pad remote and push it to my Sony Bravia TV as an APK.
  11. Make it easy and fun to play with the TV remote, for kids.
  12. Add Bluetooth controller pairing and split screen.

Part 2, making it fun to play, with Claude Opus 5.5:

  1. On the TV it plays alone. Fix the split screen: pick players and detect the gamepads.
  2. Add an easy mode for solo play. It is too easy to hit the sides.
  3. Let each player pick a character with their own remote or gamepad, coloured differently.
  4. Add a gamepad tutorial. Easy buttons: triggers to drive, X for a nitro boost.
  5. Make the cars able to jump and fly over ramps.
  6. Add cool background music and sound effects with Lyria.
  7. Add more tracks. Use Codex to generate the images.
  8. Make it playable online with gamepads and split screen, on Mac and Windows.

Two tools in there, in plain words. Three.js is a free JavaScript library that draws 3D scenes in a web page. HyperFrames is a free tool that records a web page as a video, frame by frame; it made the trailer and the launch video.

What was wrong the first time it was really played?

Four things, and none of them showed up in my own tests before.

What brokeWhyFix
Players kept hitting the sidesthe road was a flat ribbon facing down, so the GPU culled it: the track looked like grassdraw every flat road ribbon from both sides
Split screen never startedthe first gamepad became player 1, the same player as the remoteeach device owns a player; a menu row picks 1 to 4 players
The 2nd controller stopped workinga Switch Pro Controller that sleeps comes back with a new device id, and the 4 player slots ran outreuse the lowest free slot, forget a controller when it disconnects
The gamepad could not pick a ridethe menu only listened to buttons, not to stick or D-pad motionstick and D-pad flicks act like arrow presses

The first one is my favourite. Every screenshot looked fine on a Mac, because the camera there never looked at the road from the angle that hides it. On the TV it was one big green field, and of course everyone drove into the walls.

How does EASY mode steer for you?

You still steer: pushing left or right moves you across the road right away. When you let go, the kart follows the road in the lane you are in, and it never aims closer than 2.3 m to the edge. Walls you still touch only take 4% of your speed instead of 10%.

Test: 20 s of gas, no steeringEASYMANUAL
Wall touches07
Furthest from the road centre1.1 m10.5 m

The Turbo Kartz menu: each player picks a ride, then the number of players, the mode and the track

The menu is three rows you move through with up and down: ride, players (1 vs bots up to 4), mode (EASY, MANUAL, KIDS), track. Every remote or gamepad has its own cursor, so player 2 picking a kart never changes player 1’s row.

How do jumps work?

Ramps sit on the three straightest stretches of each track, measured from the track’s curvature. The kart climbs the wedge, leaves the top edge with the speed it climbed at plus a small pop, and lands 1.0 to 1.7 s later. Press any button in the air for a trick: a 360 spin and a 1 second boost when you land. Launch speed is capped, because the first version threw the kart 9.75 m into the air on the steepest ramp.

A Turbo Kartz kart on a wide grey road heading for a yellow and black jump ramp

Which tracks are there?

Four, each with its own road shape, colours and ramps. Codex painted the picture for each one in the menu, from screenshots of the game.

TrackLengthTightest cornerLook
Sunny Meadow837 m26 m radiusthe original: green hills, grandstands
Candy Canyon1,056 m24 m radiuspink sky, candy road, chocolate lake
Snowy Peaks1,057 m17 m radius (a hairpin)snow, frozen lake
Beach Bay1,115 m29 m radiussunset, sand, turquoise water

Every track passed the same test before it shipped: a lap in EASY mode with gas held and no steering, 0 wall hits. The first Candy Canyon and Snowy Peaks failed it; their tightest corners (13.6 m and 11.1 m) were sharper than half the 24 m road, so the road folded over itself. I widened them.

Candy Canyon track art: candy hills, lollipop trees and a chocolate river Snowy Peaks track art: an icy road, snowmen, ice arches and northern lights Beach Bay track art: a sandy road along a turquoise sea with palm trees and a lighthouse

How does split screen with gamepads work?

Every controller that presses A joins as the next player, up to four, and the screen splits in halves or quarters. Each player has their own camera, colour, position and power meter, and their half of the screen is labelled with the player number and the controller.

Turbo Kartz in 2-player split screen: P1 gamepad 1 on top, P2 gamepad 2 below

On the TV, the Android app gives each gamepad a player slot and forwards its buttons and stick to the game. This is the part worth copying if you wrap a web game for Android TV:

/** Player slot for a gamepad (or a real keyboard), -1 for the TV remote. Lowest free slot, so a
 *  controller that sleeps and reconnects with a new device id does not use up the 4 slots. */
private int padSlot(InputEvent e) {
    int src = e.getSource();
    boolean pad = (src & InputDevice.SOURCE_GAMEPAD) == InputDevice.SOURCE_GAMEPAD
            || (src & InputDevice.SOURCE_JOYSTICK) == InputDevice.SOURCE_JOYSTICK;
    if (!pad) return -1;
    int id = e.getDeviceId();
    int i = padSlots.indexOfKey(id);
    if (i >= 0) return padSlots.valueAt(i);
    for (int slot = 0; slot < 4; slot++) {
        if (padSlots.indexOfValue(slot) < 0) { padSlots.put(id, slot); return slot; }
    }
    return -1;
}

@Override public void onInputDeviceRemoved(int id) {   // InputManager.InputDeviceListener
    int i = padSlots.indexOfKey(id);
    if (i >= 0) {
        int slot = padSlots.valueAt(i);
        padSlots.delete(id);
        web.evaluateJavascript("window.__padGone && window.__padGone(" + slot + ")", null);
    }
}

In the browser the same game reads the standard Gamepad API. Two details matter. A browser only shows a controller after its first button press, so the menu says “press A on each one to join”. And on the standard layout the D-pad arrives as buttons 12 to 15, not as an axis, or every menu press moves twice.

The Turbo Kartz gamepad tutorial: R or ZR gas, ZL brake, L drift, X nitro boost

Where do the music and art come from?

The music is Lyria 3 Pro, Google’s music model, at $0.08 per call: a 150 BPM race loop and a 118 BPM menu loop, each cut to a seamless loop. It also made the jump, landing and boost sounds, though it is better at music than at short effects: I had to cut each effect down to its loudest half second. The prompts are on the prompts page.

The track pictures and the starting-grid poster are Codex image generation, given screenshots of the real game so the characters stay the same.

Sonnet 5.5 vs Opus 5.5: does the cheaper model win?

Once, on the benchmark closest to what this game needed. Sonnet 5.5 scores 70.6% on Terminal-Bench 4.0, a test of coding in a terminal, against 66.4% for Opus 5.5. Opus leads the other seven.

Benchmark (Anthropic, 28 Sep 2026)Sonnet 5.5Opus 5.5Gap
Terminal-Bench 4.070.6%66.4%+4.2
FrontierCode 1.1 (Main, Max)46.2%54.4%-8.2
CursorBench 4.055.5%57.8%-2.3
GDPval-AA v2.118441846-2
AA-Briefcase v1.118111822-11
Humanity’s Last Exam (with tools)64.5%67.7%-3.2
OSWorld 2.1 (partial)80.1%81.8%-1.7
Chartography (no tools)61.6%64.4%-2.8
Price per 1M tokensSonnet 5.5Opus 5.5
Input$2$4
Output$10$20
Cache reads$0.20$0.20
Cache writes$2.50$5

Caveats

  • Two models. Sonnet 5.5 built the game; the TV upgrade, EASY mode, jumps, tracks and web gamepads were Opus 5.5. The title is about the build; this post is about both.
  • Frame rate on the TV. My first measurement on the BRAVIA was 15 fps during a race. Two full-screen effects cost about 10 fps; they are off on TV now, and the resolution adapts when the frame rate drops. I have not re-measured the final build on the TV yet.
  • Browser gamepads were simulated. The Chrome and Safari tests used two fake standard gamepads through the real Gamepad API. Real controllers were tested on the TV app.
  • Benchmarks are vendor-reported. I did not rerun any of them.
  • No build cost. I did not log the tokens, so there is no dollar figure for the code.

My take

The best prompt in this whole project was not mine. It was the first real play test: “it plays alone”, “it keeps hitting the walls”. No amount of my own testing found the invisible road, because I was testing what I expected to see. Ship early, hand the controller to someone else, and paste their complaints into the prompt box word for word.

Sources

Independent tutorial by Anass Kartit, kartit.net. Game built with Claude Sonnet 5.5 and Claude Opus 5.5. Not affiliated with Anthropic or Sony. Video made with HyperFrames.

Newsletter

Get the next post and game in your inbox

One email when I publish something new: measured write-ups on AI, local models and cloud, plus games like NEON RUN.

Your email is never shown or shared. What is stored and how to leave