A terminal-based implementation of the classic Tetris game using the Textual framework.
This project creates an engaging, visually appealing Tetris experience that runs directly in the terminal. It leverages the Textual framework to provide a rich terminal user interface with colors, animations, and responsive controls.
-
Complete Tetris game mechanics
- All standard tetromino shapes (I, J, L, O, S, T, Z)
- Rotation and movement
- Line clearing
- Increasing difficulty/speed
- Score tracking
- Game over detection
-
Beautiful terminal user interface
- Game board visualization
- Score and level display
- Next piece preview
- Game controls display
-
Intuitive keyboard controls
- Arrow keys for movement
- Rotation
- Hard drop and soft drop
- Hold piece functionality
- Pause/resume game
This project uses rye for dependency management.
# Clone the repository
git clone <repository-url>
cd textual-tetris-game
# Set up the project with rye
rye sync
# Run the game
python -m textual_tetris_game
textual-tetris-game/
├── pyproject.toml # Project configuration
├── README.md # Project documentation
├── src/
│ └── textual_tetris_game/
│ ├── __init__.py
│ ├── __main__.py # Entry point
│ ├── cli.py # Command-line interface
│ ├── game.py # Game logic
│ └── ui.py # User interface
└── tests/
└── test_game.py # Game logic tests
pytest