This project is a simple implementation of the classic Tetris game using the raylib library for graphics. The game includes features like score tracking and a game over screen, and uses a custom font for text rendering.
- Classic Tetris gameplay
- Score tracking
- Next piece preview
- Music and sound effects
- CMake (minimum version 3.17)
- C++ compiler (e.g., g++)
- Clone the repository:
git clone https://github.com/lucky017/Tetris-clone.git cd Tetris-game - Ensure you have CMake installed and accessible in your environment.
- Build the project:
mkdir build
cd build
cmake ..
make- Compile the project and run the game
The goal of the game is to fit the falling Tetris blocks together to complete and clear horizontal lines. As the game progresses, the blocks fall faster, increasing the challenge.
- Left Arrow Key: Move the block left
- Right Arrow Key: Move the block right
- Down Arrow Key: Soft drop the block (faster descent)
- Up Arrow Key: Rotate the block clockwise
- Each cleared line adds points to your score.
- The more lines you clear at once, the higher the score you will earn.
- The game uses the
rayliblibrary for graphics and audio. It is automatically fetched using CMake'sFetchContent. - Ensure all resources (fonts and sounds) are placed in their respective folders to avoid runtime errors.
- raylib for providing an easy-to-use C++ game programming library.
Feel free to modify the code and add more features to enhance the gameplay experience. Enjoy playing Tetris!