Here's a README file for the provided code:
This is a simple implementation of the classic game Tetris using the Pygame library in Python.
Make sure you have the following dependencies installed:
- Python (version 3 or above)
- Pygame
You can install Pygame using pip:
pip install pygame
To start the game, run the tetris.py
file using Python:
python tetris.py
The game window will open, and you can use the following controls:
- Up Arrow: Rotate the falling block
- Down Arrow: Move the falling block down faster
- Left Arrow: Move the falling block to the left
- Right Arrow: Move the falling block to the right
- Space: Drop the falling block to the bottom instantly
- Esc: Restart the game
The objective of the game is to clear lines by filling them completely with blocks. As the blocks fall from the top of the screen, you can rotate and move them to fit into the available spaces. Once a line is filled, it will be cleared, and your score will increase. The game ends when the blocks reach the top of the screen and there is no more space for new blocks.
![Gameplay](Screenshot (133))
Contributed by Manihas and Rafeeq
Contributions to this project are welcome. If you find any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request.