An over-engineered terminal snake game built with Rust and Ratatui.
This isn't your regular snake game. It features:
- Scope System - A dotted line shows where you're aiming, turns green when aligned with food
- Bullet Shooting - Fire bullets to collect food faster than moving
- Moving Food - Food spawns from screen edges and moves across the field
- Dangerous Food - If food hits your body (not head), it cuts your snake
cargo build --release
cargo run --release
cargo run --release -- --speed 1 # Slow (120ms tick)
cargo run --release -- --speed 2 # Normal (70ms tick, default)
cargo run --release -- --speed 3 # Fast (40ms tick)
W/K/Up- Move upS/J/Down- Move downA/H/Left- Move leftD/L/Right- Move right
F/X- Fire bulletSpace- Pause / ResumeEnter- Restart (when dead)Q/Esc- Quit
cargo test
Run with output:
cargo test -- --nocapture
The codebase is intentionally over-engineered with:
- Trait-based entity system (
Positioned,Moveable,Damageable,Segmented) - Phantom type state builder pattern for
Game - Object pool for bullets
- Event queue with ring buffer
- Type-safe
SegmentIndexfor snake segments EdgeSpawnabletrait for food spawning

