Real-time Tron lightcycle duel for the terminal.
termtron is a fast-paced competitive Tron-inspired game built entirely for the command line. Two players control futuristic light bikes, leaving deadly trails behind as they race across the arena. Outsmart your opponent, force them into a collision, and survive longer to win.
It is built in Go with a strict focus on low-level terminal rendering, utilizing a lightweight custom TUI backend to deliver smooth, responsive gameplay without relying on heavyweight terminal UI frameworks.
- Real-time: Delta Time-based update loop keeps movement smooth and consistent across different terminal speeds.
- Competitive: Local 2-player duels with simultaneous movement and collision detection.
- Authentic Tron Mechanics: Every movement leaves a permanent light trail that becomes a deadly obstacle.
- Terminal-Native: Uses Unicode box-drawing characters and ANSI colors for clean, retro-futuristic visuals.
You can build the project directly from source:
git clone https://github.com/yourusername/termtron.git
cd termtron
go build -o termtronStart the game:
./termtronControls:
# Player 1
W - Move Up
A - Move Left
S - Move Down
D - Move Right
# Player 2
↑ - Move Up
← - Move Left
↓ - Move Down
→ - Move RightSystem Controls:
ESC Pause / Resume
R Restart match
Q Quit game
Ctrl+C Force quitThe codebase is structured around a classic, strictly decoupled Game Loop architecture:
state.go: The single source of truth. Defines theGameState,Playerentities, arena board, scoring system, and match state transitions.main.go: The application entry point. Initializes the terminal backend, runs the Delta Time loop, processes resize events, and orchestrates rendering + logic updates.input.go: The input controller. Handles player movement, pause states, restart commands, and menu interactions.logic.go: The gameplay engine. Computes movement timing, trail collision detection, mutual destruction logic, scoring, and dynamic speed scaling.renderer.go: The rendering layer. Converts abstract game state into Unicode light trails, bike heads, arena borders, HUD elements, pause overlays, and victory banners.
- Minimalism: The game focuses purely on movement, positioning, and survival without unnecessary systems or visual clutter.
- Arcade Precision: Movement and collision rules are deterministic, immediate, and designed for competitive play.
- Terminal-First: Built specifically for ANSI terminals using direct cell rendering and Unicode line-drawing characters.
- Suckless: Powered by a lightweight custom TUI backend (
ttbox) instead of heavyweight frameworks, allowing precise control over rendering and performance. - Readable Architecture: The project favors flat data structures and procedural game logic, making the codebase easy to study and extend.
Contributions are welcome! Whether it's gameplay improvements, rendering optimizations, AI opponents, visual polish, or new game modes, feel free to open a Pull Request.
Please keep contributions aligned with the project's minimalist terminal-native philosophy: avoid unnecessary dependencies and preserve the lightweight architecture.
This project is licensed under the MIT License - see the LICENSE file for details.
