๐งฉ 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