Skip to content
ZapskiRetro

GB Racer

A pseudo-3D racer on the original Game Boy, in the mould of the arcade road games: a road that curves and climbs towards the horizon, two rivals to beat, traffic to weave through, and a lap record on every track, saved to the cartridge.

Game Boy (DMG)GBDK-2020 + assemblySuper Game Boy enhancedHomebrew

Emulated by binjgb (WebAssembly). Click the screen to give it keyboard focus. Open full screen.

How to play

ScreenButtons
TitleUP / DOWN pick the track · LEFT / RIGHT the race length · SELECT the difficulty · START races
RaceLEFT / RIGHT steer · A or UP accelerate · B or DOWN brake (works while you hold A)
PauseSTART pauses · UP / DOWN pick RESUME, RESTART, QUIT or SOUND ON/OFF · A or START chooses · B resumes

The brake beats the throttle, so the trick is to hold A and tap B for a bend. The sign in the sky warns of a sharp bend ahead and flashes when you are too fast for it on this lap and difficulty. Off the road the car is capped at a crawl and barely steers, so a mistake costs time rather than throwing you further out. Races run 3, 5 or 10 laps, and the bends push harder every lap.

Keyboard

  • D-padArrow keys
  • AX
  • BZ
  • STARTEnter
  • SELECTC

Emulator

  • Toggle the SGB borderS
  • Fast-forwardShift
  • PauseSpace
  • Save / load stateF6 / F9
  • RewindBackspace

Tracks

  • OVAL — Two wide sweeps each way, nothing sharp, and almost flat. Learn the car here.
  • CANYON — A mix of bends, three of them tight, over rolling hills that bleed speed on the climb and hand it back on the way down.
  • ALPINE — The hardest: back-to-back bends left-right-left, steep climbs and drops, and flat out loses clearly to braking.

Difficulty

EASY, NORMAL and HARD change the car as well as the rivals: the push out of a bend is 0.75× on EASY, 1× on NORMAL and 1.25× on HARD. The best time for every track, level and race length is kept in battery-backed save RAM — 27 records in all.

Super Game Boy

GB Racer mid-race inside its Super Game Boy border: the road curving away to the horizon with the HUD showing speed, lap and position

On a Super Game Boy the screen sits in a race circuit: chequered flags, red and white kerbs, grass and a starting grid — 56 tiles and one palette, drawn by a script and packed with our GB-SGB-Tooling. The emulator starts with the border on — press S to toggle it. On a regular Game Boy nothing changes.

Under the hood

The Game Boy has no 3D hardware and no way to draw a road, so GB Racer bends a flat one. A hand-written assembly interrupt runs on every line of the road as the screen is drawn and rewrites the horizontal scroll and palette for that line: shift each line a little more and the road curves, swap the palettes and the stripes rush towards you. The tables for the next frame are built while the current one is on screen, and double-buffered.

You see a bend before you reach it. The road is drawn as two bends — the one the car is in and the next one beyond — and the join between them comes down the screen at the road's own speed, so a bend appears on the horizon and arrives at the car, which only feels it once it gets there.

The car has weight: the tyres take a couple of frames to build up grip, so it keeps sliding for a moment after you let go, and a climb bleeds speed off while a descent gives it back. Written in C with GBDK-2020 plus assembly, on a 128 KB MBC1 cartridge with battery RAM, and tested by bots that drive it in PyBoy — including one with a person's reaction time.

More about GB Racer

More games