Skip to content

The purpose of this project is learning C++ and SDL2 library. Minesweeper, Tetris and Snake is currently available.

Notifications You must be signed in to change notification settings

KonstantinZavertkin/SimpleSDLGames

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SimpleSDLGames

The purpose of this project is learning C++ and SDL2 library. Minesweeper, Tetris and Snake are currently available.

Installation instructions

Requirements:

  • CMake 3.8 or newer
  • Сompiler supporting C++17 or newer
  • SDL2
  • SDL2_ttf

On Debian-based systems (including Ubuntu) SDL2 and SDL2_ttf libraries can be installed using the following commands:

    sudo apt-get install libsdl2-2.0  
    sudo apt-get install libsdl2-dev  
    sudo apt-get install libsdl2-ttf-dev  

On Windows you need to download and install these libraries:

Building the executable file on Linux-based OS can be done using the following commands:

    mkdir build  
    cd build  
    cmake ..  
    make all    

Run:

    ./GameRunner  

Use cmake-gui to create solution for Visual Studio on Windows. Set 'Where is the source code' to root of this repository (For example, C:/SimpleSDLGames/). Set 'Where to build the binaries' to some new directory in root of repository (For example, C:/SimpleSDLGames/build)
After 'Configure' stage cmake will requests for paths to header files and to compiled libraries (SDL2 and SDL2_ttf).
You need to set up these variables:

    SDL2_INCLUDE_DIRS  
    SDL2_LIBRARIES_DIRS  
    SDL2_TTF_INCLUDE_DIRS  
    SDL2_TTF_LIBRARIES_DIRS  

To run game after building, go to the directory with binaries (For example, C:/SimpleSDLGames/build/Debug) and run GameRunner.exe

Tested on Debian 10 and Windows 10.

Screenshots

Main menu Minesweeper
Tetris Snake

About

The purpose of this project is learning C++ and SDL2 library. Minesweeper, Tetris and Snake is currently available.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published