Skip to content

ttasc/termtron

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🏍️ termtron

Real-time Tron lightcycle duel for the terminal.

Overview

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.

Features

  • 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.

Installation

You can build the project directly from source:

git clone https://github.com/yourusername/termtron.git
cd termtron
go build -o termtron

Usage

Start the game:

./termtron

Controls:

# Player 1
W - Move Up
A - Move Left
S - Move Down
D - Move Right

# Player 2
↑ - Move Up
← - Move Left
↓ - Move Down
→ - Move Right

System Controls:

ESC      Pause / Resume
R        Restart match
Q        Quit game
Ctrl+C   Force quit

Architecture

The codebase is structured around a classic, strictly decoupled Game Loop architecture:

  • state.go: The single source of truth. Defines the GameState, Player entities, 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.

Design Philosophy

  • 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.

Contributing

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.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Real-time Tron lightcycle duel for the terminal.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages