Skip to content

About

A Opus 4.6 developed rust tui using https://ratatui.rs/

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Developed with Opus 4.6

🏀 rust-tui-ball-bounce

A terminal-based bouncing ball simulation built with Rust, featuring real-time physics, ball-to-ball elastic collisions, and live telemetry graphs — all rendered in your terminal using Ratatui and Crossterm.

Rust

Features

  • Ball Arena — Watch balls bounce around a bordered arena rendered directly in your terminal
  • Elastic Collisions — Balls collide with each other using physically accurate elastic collision resolution
  • Multiple Balls — Add or remove balls on the fly, each with a unique color and symbol (●, ◉, ○, ◎, ◆, ■, ▲, ★)
  • Live Telemetry Graphs — Four real-time charts display X position, Y position, X velocity, and Y velocity over time using Braille-dot rendering
  • Speed Control — Adjust the simulation speed from 0.25× to 5.0×
  • Pause/Resume — Freeze and unfreeze the simulation at any time
  • ~60 FPS — Smooth animation at approximately 60 frames per second

Getting Started

Prerequisites

  • Rust (2021 edition or later)

Build & Run

# Build and run
cargo run 

Controls

Key Action
Space / P Pause / Resume
+ / = / A Add a ball
- / _ / R Remove a ball
↑ Speed up
↓ Speed down
Q / Esc Quit

Layout

The TUI is divided into three rows:

Section Contents
Top Ball arena (left) and status/controls panel (right)
Middle X Position graph (left) and Y Position graph (right)
Bottom X Velocity graph (left) and Y Velocity graph (right)

Each graph tracks up to 300 ticks of history per ball, with all balls plotted simultaneously in their respective colors.

Dependencies

Crate Version Purpose
ratatui 0.29 Terminal UI framework (widgets, layout, charts)
crossterm 0.28 Cross-platform terminal manipulation (input, raw mode)

License

This project is open source. Feel free to use, modify, and distribute it as you see fit.

About

A Opus 4.6 developed rust tui using https://ratatui.rs/

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages