A small C++/SFML implementation of classic Tetris. This repository is intentionally compact and is a good base for incremental gameplay improvements.
- Falling tetrominoes with left/right movement
- Piece rotation (
Uparrow) - Soft drop (
Downarrow) - Line clearing
- Lightweight sprite-based rendering (
images/assets)
sudo apt update
sudo apt install -y build-essential cmake libsfml-devgit clone https://github.com/microsoft/vcpkg $env:USERPROFILE\vcpkg
& $env:USERPROFILE\vcpkg\bootstrap-vcpkg.bat
cmake -S . -B build `
-DCMAKE_TOOLCHAIN_FILE=$env:USERPROFILE\vcpkg\scripts\buildsystems\vcpkg.cmake `
-DVCPKG_TARGET_TRIPLET=x64-windows
cmake --build build --config Releasegit clone https://github.com/<your-username>/Tetris.git
cd Tetriscmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --config ReleaseGitHub Actions builds on Ubuntu using cmake, g++, and libsfml-dev from apt to keep CI simple and reliable.
./build/tetrisThe game expects
images/to be beside the executable. The CMake build copies this folder automatically after build.
↑Rotate piece←Move left→Move right↓Soft drop (faster fall while held)- Close window to quit
- No score or level progression yet
- No next-piece preview or hold mechanic
- No hard drop
- No game-over screen/reset flow
- No pause/restart hotkeys
- Random piece generation is purely
rand()based (not 7-bag)
This project is licensed under the MIT License. See LICENSE.