🧩 Classic Tetris game implemented in Python using Pygame. Dive into the world of falling blocks and strategic thinking!
- 🎯 Large game field: 25×50 cells for long gaming sessions
- 🧩 7 types of tetrominoes: All classic shapes (I, O, T, S, Z, J, L)
- 📈 Progressive difficulty: Level increases every 10 cleared lines
- 💯 Smart scoring system: Bonuses for clearing multiple lines at once
- 👀 Preview: Shows the next shape for strategic planning
- 🎨 Colored blocks: Each shape has a unique color
- ⚡ Smooth animation: 60 FPS for comfortable gameplay
| Key | Action |
|---|---|
← → |
Move shape left/right |
↓ |
Accelerated shape fall |
↑ |
Rotate shape clockwise |
Space |
Instant shape fall to bottom |
R |
Restart game |
| Lines cleared | Points |
|---|---|
| 1 line | 100 × level |
| 2 lines | 300 × level |
| 3 lines | 500 × level |
| 4 lines (Tetris!) | 800 × level |
💡 Tip: Try to clear 4 lines at once for the maximum number of points!
# Install all required dependencies
pip install -r requirements.txtOr install Pygame manually:
pip install pygame>=2.0.0# Clone repository
git clone https://github.com/Roosso/Tetris-Game.git
cd tetris
# Run game
python tetris.py- 🐍 Python: 3.6 or higher
- 🎮 Pygame: 2.0 or higher
- 💾 RAM: minimum 64 MB
- 🖥️ Screen resolution: minimum 800×600
| Parameter | Value |
|---|---|
| Cell size | 20 pixels |
| Game field size | 25×50 cells |
| Window size | 450×600 pixels |
| Frame rate | 60 FPS |
| Initial speed | 30 frames per block |
- Goal: Fill horizontal lines with blocks to make them disappear
- Shapes: Control falling tetrominoes of different shapes
- Levels: With each level, the speed of falling increases
- End of game: The game ends when blocks reach the top of the screen
tetris.py
├── Tetris class
│ ├── Game initialization
│ ├── Shape control
│ ├── Game field logic
│ ├── Scoring system
│ └── Interface drawing
└── Main game loop
We welcome contributions to the project! If you have ideas for improvement:
- 🍴 Fork the repository
- 🌿 Create a branch for a new feature (
git checkout -b feature/AmazingFeature) - 💾 Commit changes (
git commit -m 'Add some AmazingFeature') - 📤 Push to the branch (
git push origin feature/AmazingFeature) - 🔄 Open a Pull Request
This project is distributed under the MIT license. See the LICENSE file for details.
- 🙏 Thank you to Alexey Pazytnov for creating the original Tetris
- 🐍 Thank you to the Python team for the excellent programming language
- 🎮 Thank you to the Pygame developers for the powerful library for games
Enjoy the game! 🎮✨
Made with ❤️ for lovers of classic puzzles