A classic Tetris implementation built using SFML (Simple and Fast Multimedia Library). This project brings the timeless puzzle game to life with modern graphics and smooth gameplay.
This is a feature-complete Tetris game implemented using SFML. The game follows the standard Tetris mechanics and rules as described on Wikipedia.
- Classic Tetris gameplay mechanics
- Smooth piece movement and rotation
- Score tracking system
- Increasing difficulty levels
- Modern graphics using SFML
Before you begin, ensure you have the following installed:
- SFML - Simple and Fast Multimedia Library
- Git - Version Control System
- CMake - Cross-platform build system
-
Clone the repository:
git clone https://github.com/yourusername/Tetris-SFML.git cd Tetris-SFML
-
Create a build directory:
mkdir build cd build
-
Generate build files with CMake:
cmake ..
-
Build the project:
cmake --build .
- Left Arrow: Move piece left
- Right Arrow: Move piece right
- Down Arrow: Soft drop
- Space: Hard drop
- Up Arrow: Rotate piece
- P: Pause game
- ESC: Exit game
- Pieces fall from the top of the screen
- Complete lines are cleared and award points
- Game ends when pieces stack up to the top
- Score increases with each line cleared
- Speed increases as you progress
Contributions are welcome! Feel free to submit issues and pull requests. For major changes, please open an issue first to discuss what you would like to change.
- Fork the repository
- Create your feature branch (
git checkout -b feature/YourFeature
) - Commit your changes (
git commit -m 'Add some feature'
) - Push to the branch (
git push origin feature/YourFeature
) - Open a Pull Request
- Original Tetris game design by Alexey Pajitnov
- SFML development team for their excellent multimedia library
- The open-source community for various resources and inspirations