A terminal-based Tetris game implemented in Rust using ratatui
for the terminal UI and bevy_ecs
for game logic.
- Classic Tetris gameplay
- Terminal-based UI with colors
- Entity Component System (ECS) architecture
- Scoring system with levels
- Smooth animations and controls
- ←/→: Move tetromino left/right
- ↓: Soft drop (move down faster)
- ↑/Space: Rotate tetromino
- E: Hard drop (drop all the way down)
- Q: Quit the game
- Enter: Restart after game over
Make sure you have Rust installed, then navigate to the game directory and run:
cd fallingblocks
cargo run
This game uses the following dependencies:
- ratatui: Terminal UI library
- bevy_ecs: Entity Component System from the Bevy game engine
- fastrand: Fast random number generation
- crossterm: Terminal manipulation
- tracing: Logging
main.rs
: Entry point, sets up the terminal and game loopapp.rs
: Main application structure and state managementcomponents.rs
: ECS components for game entitiessystems.rs
: ECS systems that handle game logicui.rs
: Terminal UI rendering codegame.rs
: Game constants and configuration
MIT