Welcome to the C++ Tetris Game repository! This project showcases a classic Tetris game built with the C++ programming language and the raylib library. The game is designed to run smoothly on Windows, macOS, and Linux.
-
Cross-Platform: Playable on Windows, macOS, and Linux.
-
Graphics: Utilizes raylib for rendering colorful and dynamic graphics.
-
Audio: Engaging sound effects and background music powered by raylib.
-
Input Handling: Smooth and responsive controls for an enjoyable gaming experience.
-
Open Source: Well-structured and readable code for educational purposes.
To get started with the C++ Tetris game, follow these steps:
- Ensure you have a C++ compiler installed (e.g., GCC, Clang, MSVC).
- Download and install the raylib library.
-
Clone this repository:
git clone https://github.com/yourusername/tetris-raylib.git cd tetris-raylib
-
Compile the source code:
g++ -o tetris main.cpp -lraylib -lm -ldl -lpthread -lX11
-
Run the game:
./tetris
Simply run the compiled executable to start playing the game. Use the following controls to play:
- Left Arrow: Move the Tetrimino left
- Right Arrow: Move the Tetrimino right
- Up Arrow: Rotate the Tetrimino
- Down Arrow: Speed up the Tetrimino's descent
- Spacebar: Drop the Tetrimino
The objective of Tetris is to clear lines by guiding falling Tetriminos to fit them into complete horizontal rows. Each cleared line awards points and the game speeds up as you progress. Try to score as high as possible!
Contributions are welcome! If you find any bugs or have ideas for new features, feel free to open an issue or submit a pull request. Please ensure your contributions adhere to the project's coding standards and guidelines.
- raylib: Raylib library by Ray San
- Tetris Concept: Originally designed and programmed by Alexey Pajitnov
Happy gaming and happy coding! 🎮🚀