A modern web remake of a Tron light-cycle game first written in C + SDL 1.2 in 2013 as a university project (LIF7, Université Claude Bernard Lyon 1) by Antoine Caron and Matthieu Billet.
The original still lives at github.com/Slashgear/projet-tron. This repository rebuilds it — same feel, same mechanics — on a deterministic fixed-step simulation with a Canvas renderer.
Local, couch-multiplayer. Bikes accelerate forever and leave a trail that fades after a while; last one riding wins the round, first to the target score wins the match.
- Steering — press the perpendicular direction to turn.
- P1
ZQSD+A· P2OKLM+I· P3TFGH+R· P4 arrows +End - Gamepads: pad i drives player i (Xbox layout — Y/A/X/B steer, RB is bonus).
- P1
- Bonuses — drive over them:
- CLEAN wipes every trail instantly.
- BOOST — armed on pickup; hit your bonus key for a burst of speed.
- JUMP — armed on pickup; hit your bonus key to phase through trails briefly.
- AI — any player slot past the human count is a computer opponent (easy / normal / hard).
Mtoggles music ·Ctoggles the CRT filter ·Escreturns to the menu.
| Concern | Tool |
|---|---|
| Runtime / PM | Bun |
| Bundler | Bun (bun build ./index.html) |
| Language | TypeScript (strict) |
| Lint | oxlint |
| Format | oxfmt |
| Tests | bun test |
| Audio | Web Audio (fully synthesised — no asset files) |
| Hosting | GitHub Pages (static) |
bun install
bun run dev # dev server + HMR at http://localhost:3000
bun test # simulation + AI unit tests
bun run check # typecheck + lint + format check + tests
bun run build # production build into dist/See CONTRIBUTING.md for conventions.
src/
sim/ pure simulation — no DOM, no Canvas — fully unit-tested
bike · trail · collision · bonus · match · rng
ai/ coarse analysis grid + BFS + a scored-move brain
input/ keyboard · gamepad
render/ Canvas 2D renderer · trail tracker · particles · effects
audio/ synthesised SFX · procedural music
game/ config (ex-Constantes.h) · fixed-step loop · screen flow · App
ui/ DOM overlay screens
main.ts
Every simulation and AI module cites the 2013 C function it was ported from
(bougeMoto at Jeu.c:234, the JeuActionClavier turn geometry, the
creerGrilleDistances flood fill, …). The heart of the port:
| 2013 (C / SDL) | here |
|---|---|
JeuEvolue — the game tick |
sim/match.ts Match.tick |
Constantes.h — recompile to tune |
game/config.ts — a runtime object |
choisieDirection — 450-line tree |
ai/brain.ts — a scored evaluator |
clock() frame timing |
fixed 20 Hz step + interpolated render |
srand(time(NULL)) all over |
one seeded Rng, threaded — replayable |
| FMOD + commercial soundtrack | Web Audio, procedurally generated |
- Antoine Caron & Matthieu Billet — original 2013 game.
- Font: Orbitron (Open Font License).
WTFPL — do what the fuck you want to.
