Welcome to Tetris, a classic puzzle game where you arrange falling blocks to clear lines and score points. This project is an implementation of the iconic game in Python, developed using object-oriented programming principles.
- Features
- Installation
- Usage
- Demo
- File Structure
- Technologies
- Contributing
- License
- About This Project
- Classic Tetris gameplay
- Random piece generation from a predefined set
- Score system with database storage
- Graphical interface with intuitive controls
To run this project locally, follow these steps:
-
Clone the repository:
git clone https://github.com/SebaB29/Tetris.git
-
Navigate to the project directory:
cd Tetris
-
Run the game:
python main.py
Use the following controls to play the game:
- A: Move left
- D: Move right
- W: Rotate piece
- S: Drop piece quickly
- P: Pause
The project structure is as follows:
Tetris/
├── graphics/
│ ├── gamelib.py
│ └── tetris_gui.py
├── img/
│ └── TetrisDemo.gif
├── resources/
│ └── piezas.txt
├── src/
│ ├── constantes.py
│ ├── generador_pieza.py
│ ├── pieza.py
│ ├── sistema_puntaje.py
│ ├── tablero.py
│ └── tetris.py
├── main.py
├── README.md
├── LICENSE
└── .gitignore
- graphics/: Contains graphical libraries for rendering the game.
- img/: Includes a demo GIF showcasing the game's functionality.
- resources/: Contains the pieces configuration file (
piezas.txt
). - src/: Includes source code files responsible for various game functionalities.
- main.py: The entry point of the application.
This project is built with:
- Python
- SQLite3 (for score management)
- Gamelib (A library created by the instructor to facilitate the use of threads and rendering for the interface)
Contributions are welcome! If you'd like to improve the game, feel free to fork the repository and submit a pull request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a pull request
Distributed under the MIT License. See LICENSE
for more information.
This project was developed as a practical assignment for university. It aims to implement the classic Tetris game using Python, focusing on game logic, graphical interface, and data management through object-oriented programming principles.