Live demo: https://prompt-racers.vercel.app/
Describe a car or motorcycle, then street-race friends on a shared night highway. Everyone joins with a room code from their own phone or laptop. Nobody signs in and nobody installs a game.
The server owns the race. Browsers send steering, brake, and nitro. Positions, traffic hits, and the finish order come back from the server.
- Runtime: Node.js 18+
- Realtime: WebSockets with a 20 Hz authoritative server tick
- Client: Three.js night-highway scene in
public/ - Shared rules: prompt-to-vehicle interpreter + race logic in
shared/race.js
Requires Node.js 18 or newer.
npm install
npm startOpen http://localhost:3080.
The terminal also prints a network address, for example http://192.168.x.x:3080. Friends on the same Wi-Fi open that address. If their browser cannot connect, allow Node through the Windows firewall.
Set PORT to use another port:
set PORT=4000
npm startnpm run sim runs a headless race check and does not start the server.
- Enter your name and describe the vehicle. The garage turns that sentence into a body, an engine, and the numbers you actually drive.
- Press Create room. Share the 4-character code or the join link.
- Friends build a car and press Join room.
- Pick a mode and press Start race. One driver can practice alone. A room holds up to 8 drivers.
The car accelerates by itself.
| Input | Action |
|---|---|
| Left / Right arrows, or A / D | Steer |
| Space | Brake |
| Shift | Nitro |
| On-screen buttons | Same controls on a phone |
A gamepad left stick steers. Face buttons and triggers brake or fire nitro.
- Street Race — 2.6 km. First across the line wins. Drift points break a tie.
- Traffic Rush — shorter highway, denser traffic, same finish rule.
- Survival — 75 seconds. The farthest car that is still in one piece wins.
Traffic is slower than you. A hit costs speed and integrity. About five solid hits wreck a normal car. Trucks take more. Motorcycles take less. Brake to drop into a gap. Nitro is a short burst, then it recharges. Sit behind another player in the same lane for a slipstream.
Browser (Three.js HUD + input)
| WebSocket: steer / brake / nitro
v
server.js -- 20 Hz tick --> shared/race.js rules
|
v
Broadcast positions, collisions, finish order
The garage reads the prompt on the device and builds a 3D car from that spec. It does not call an image model.
| Path | Role |
|---|---|
server.js |
Rooms, WebSockets, and the 20 Hz authoritative tick |
shared/race.js |
Prompt interpreter, track, and race rules shared by the server and the browser |
public/ |
Garage, HUD, and the Three.js night highway |
scripts/sim.js |
Headless race check |
MIT — see LICENSE.
