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
- About This Project
- License
- Security Policy
- Code of Conduct
- 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/
├── .github/
│ ├── CODE_OF_CONDUCT.md
│ ├── CONTRIBUTING.md
│ ├── SECURITY.md
│ └── ISSUE_TEMPLATE/
│ └── bug_report.md
├── 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! Please check the CONTRIBUTING.md file for detailed guidelines on how to contribute.
- 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
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.
Distributed under the MIT License. See LICENSE for more information.
Please review our SECURITY.md for security-related information and how to report vulnerabilities.
This project follows the Contributor Covenant Code of Conduct. By participating, you agree to abide by its guidelines.
