ROADLINE '91

A point-to-point racing game in the style of the early polygon racers of around 1990 – flat-shaded polygons, a 320×200 picture where every pixel is an index into a 256-color palette, Bayer dithering and FM music. Pure JavaScript and WebGL2, no libraries, no external assets.

▶ PLAY IN THE BROWSER

Screenshots

Title screen with a color-cycled logo and a turning car
Title screen with palette color cycling
Car and race setup screen
Four fictional cars, each with its own character
Cockpit view on the coast road
Cockpit with working gauges and a rear-view mirror
Cliff road with a lighthouse at sunset
Sea cliff and lighthouse at sunset
Snowy mountain pass
Mountain pass with hairpins above a drop
Red rock canyon
Winding red-rock canyon
Redwood forest in the rain
Rain: wipers, drops, wet asphalt, less grip
Suburbs at night with street lamps
Night: dithered headlight wedge and street lamps
Police car overtaking on a bridge
Radar trap, chase and radar detector
Dot-matrix printed traffic citation
A citation printed like a dot-matrix printout
Desert road in fog
Fog done with dithering, never smooth blending
Replay with the top camera
Replay of the last minute with four cameras

Features

Controls

ActionKeyboardGamepad
Throttle / brake↑ / ↓ or W / SRT / LT
Steer← → or A DLeft stick, D-pad
Gear up / down (manual)E / QRB / LB
Camera / look backC / VY / R3
Replay / hornR / HBack / L3
PauseEsc or PStart
MuteM

Driving keys can be remapped in CONTROLS (title and pause menus). On phones on-screen buttons appear after the first touch.

How it is made

The world is rendered into an R8UI 320×200 texture that holds palette indices, not colors. Flat shading, fog and lighting are all quantized with a 4×4 Bayer matrix in index space; a final pass looks the indices up in a 256-entry palette texture and scales the picture to a 4:3 letterbox with nearest-neighbour sampling. Models, sounds, music and the font are defined in code – there are no image or audio files. The whole game builds into a single HTML file of about 420 KB.