Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/emmmabk/tetris

🕹ī¸ Play classic Tetris! Python-powered with Pygame. Rotate, move, and clear lines! Clone, run 'main.py' to enjoy. Customize shapes, settings. Happy gaming! 🎮🔴
https://github.com/emmmabk/tetris

classic-game gamedev pygame python pythongame tetris-game

Last synced: 29 days ago
JSON representation

🕹ī¸ Play classic Tetris! Python-powered with Pygame. Rotate, move, and clear lines! Clone, run 'main.py' to enjoy. Customize shapes, settings. Happy gaming! 🎮🔴

Awesome Lists containing this project

README

        

![tetris](https://i.ibb.co/TY6ZcBZ/Colorful-Playful-Gaming-Phone-Wallpaper.png)
# Tetris Game 🕹ī¸

This is a classic Tetris game implemented in Python using the Pygame library. The game offers a traditional Tetris experience with falling tetrominoes that you can control to complete lines and score points.

## Getting Started 🚀

### Prerequisites

- Python 3.x
- Pygame library

### Installation 🛠ī¸

1. Clone the repository:

```bash
git clone https://github.com/your-username/tetris-game.git
```

2. Install the required dependencies:

```bash
pip install pygame
```

### Running the Game â–ļī¸

Navigate to the project directory and run the following command:

```bash
python main.py
```

## Gameplay 🎮

- **Controls:**
- Use the `left` and `right` arrow keys to move the falling tetromino sideways.
- Press the `up` arrow key to rotate the tetromino clockwise.
- Use the `down` arrow key to speed up the falling of tetrominoes.
- Press `ESC` to exit the game.

- **Aim:**
- Fill complete lines horizontally to make them disappear and earn points.
- Avoid reaching the top of the screen; the game ends if the tetrominoes stack up to the top.

## Code Structure 🧱

The project contains the following main files:

- `main.py`: Contains the game's main logic and setup.
- `settings.py`: Includes various game settings and configurations.
- `tetris.py`: Manages the Tetris game mechanics and rendering.
- `tetromino.py`: Defines the tetromino blocks and their behavior.

## Customization 🎨

- **Changing Tetromino Shapes:**
- Modify the `TETROMINOES` dictionary in `settings.py` to create different shapes for tetrominoes.
- **Adjusting Game Settings:**
- Explore `settings.py` to tweak game-related constants, such as speed, colors, and screen dimensions.

## Acknowledgments 🙌

Special thanks to the Pygame community and the creators of Tetris for the inspiration.

Happy gaming! 🌟