Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/g-magdy/tetris-game
The popular addictive game of falling blocks đ§Šđšđ§ą
https://github.com/g-magdy/tetris-game
arcade game oop raylib
Last synced: about 2 months ago
JSON representation
The popular addictive game of falling blocks đ§Šđšđ§ą
- Host: GitHub
- URL: https://github.com/g-magdy/tetris-game
- Owner: g-magdy
- License: mit
- Created: 2024-06-30T20:21:42.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-07-14T10:22:59.000Z (6 months ago)
- Last Synced: 2024-07-14T12:45:02.251Z (6 months ago)
- Topics: arcade, game, oop, raylib
- Language: C++
- Homepage:
- Size: 3.45 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# đšī¸ Tetris Game đ§Šđ§ą
![Video Demo](./tetris.gif)
### Overview of Classic Tetris đŽ
**Objective:**
- Clear as many horizontal lines as possible by fitting different shapes of blocks together without leaving gaps.**Gameplay:**
1. **Playing Field:**
- A vertical grid, 10 cells wide and 20 cells high.
2. **Tetrominoes:**
- Seven shapes (I, O, T, S, Z, J, L) each consisting of four squares.
3. **Controls:**
- Move left/right, rotate, soft drop, hard drop.
4. **Line Clearing:**
- Clear filled lines, causing blocks above to move down.
5. **Scoring:**
- Points for lines cleared, with bonuses for multiple lines at once.
6. **Game Over:**
- Ends when tetrominoes stack to the top.**Strategy:**
- Plan ahead đ§
- Manage stack height đī¸
- Clear lines efficiently âī¸Classic Tetris combines strategic planning, quick reflexes, and spatial awareness, making it a timeless and engaging puzzle game. đšī¸
## ⨠Features
- Music and sound effects by [Teo Lympero](https://assetstore.unity.com/publishers/63245)
- Next Block Preview
- Score Counter## đŽ Controls
- **Player:**
- move right: `Right Arrow Key`
- move left: `Left Arrow key`
- rotate block: `Up Arrow Key`
- soft drop: `Down Arrow key`
- hard drop: `Space key`## đ Requirements
- C++ compiler (e.g., g++)
- Raylib library## đģ Installation
1. **Clone the Repository:**
```sh
git clone https://github.com/g-magdy/tetris-game.git
cd tetris-game
```2. **Install Raylib:**
Follow the instructions on the [Raylib website](https://www.raylib.com/) to install Raylib for your operating system.3. **Compile the Game:**
```sh
make game
```4. **Run the Game:**
```sh
./game
```## đ Code Structure
- **main.cpp:** Contains the main game loop and initialization code.
- **Constants.h** Contains global configuration and constants
- **Game class** Contains the game logic and player's score
- **Block class** parent class of all blocks, contains movement and drawing methods
- **Grid class** stores the placed blocks and provides utility functions for game class
- **Position class** encapslates row and column attributes of each cell## đ¤ Contributing
Currently, I am the only contributor to this project. However, if you have suggestions or improvements, feel free to fork the repository and create a pull request.
## đ License
This project is open source and available under the [MIT License](LICENSE).
Enjoy playing đšī¸ Tetris! đ§Šđ§ą