Skip to content

Repository files navigation

TRON — The Grid

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.

In-game screenshot

Play

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 · P2 OKLM + I · P3 TFGH + R · P4 arrows + End
    • Gamepads: pad i drives player i (Xbox layout — Y/A/X/B steer, RB is bonus).
  • 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).
  • M toggles music · C toggles the CRT filter · Esc returns to the menu.

Stack

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)

Develop

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.

Layout

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

Credits

  • Antoine Caron & Matthieu Billet — original 2013 game.
  • Font: Orbitron (Open Font License).

License

WTFPL — do what the fuck you want to.

About

Modern web remake of a Tron light-cycle game two of us wrote in C/SDL in 2013 — TypeScript, Canvas, deterministic sim, flood-fill AI.

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Contributors

Languages