Skip to content

A classic Tetris game implemented in C++ using the SFML library. This project demonstrates the use of object-oriented programming and graphical rendering techniques to recreate the iconic block-stacking puzzle game with smooth gameplay and engaging visuals.

Notifications You must be signed in to change notification settings

mohsinm-dev/tetris-sfml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tetris-SFML

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.

Description

This is a feature-complete Tetris game implemented using SFML. The game follows the standard Tetris mechanics and rules as described on Wikipedia.

Features

  • Classic Tetris gameplay mechanics
  • Smooth piece movement and rotation
  • Score tracking system
  • Increasing difficulty levels
  • Modern graphics using SFML

Screenshots

Tetris Game Screenshot 1 Tetris Game Screenshot 2

Prerequisites

Before you begin, ensure you have the following installed:

  • SFML - Simple and Fast Multimedia Library
  • Git - Version Control System
  • CMake - Cross-platform build system

Build and Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/Tetris-SFML.git
    cd Tetris-SFML
  2. Create a build directory:

    mkdir build
    cd build
  3. Generate build files with CMake:

    cmake ..
  4. Build the project:

    cmake --build .

Controls

  • 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

Game Rules

  • 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

Contributing

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.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/YourFeature)
  3. Commit your changes (git commit -m 'Add some feature')
  4. Push to the branch (git push origin feature/YourFeature)
  5. Open a Pull Request

Acknowledgments

  • Original Tetris game design by Alexey Pajitnov
  • SFML development team for their excellent multimedia library
  • The open-source community for various resources and inspirations

About

A classic Tetris game implemented in C++ using the SFML library. This project demonstrates the use of object-oriented programming and graphical rendering techniques to recreate the iconic block-stacking puzzle game with smooth gameplay and engaging visuals.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages