This is a classic Tetris game implemented in C++ using the SDL2 library.
- Classic Tetris gameplay with 7 standard tetromino shapes.
- Colorful blocks and grid.
- Line clearing mechanics.
- Game over detection.
- Pause functionality (press Spacebar).
- SDL2 library
- C++ compiler (e.g., g++, clang++)
- Make sure you have SDL2 installed on your system.
- Clone this repository.
- Navigate to the project directory.
- Compile the code using a C++ compiler:
or use
g++ -o tetris game.cpp -lSDL2
CMake
cmake .
cmake --build .
- Run the executable
./tetris
- Left Arrow: Move tetromino left
- Right Arrow: Move tetromino right
- Down Arrow: Soft drop tetromino
- Up Arrow: Rotate tetromino
- Spacebar: Pause/unpause game
- Escape: Quit game