iikerm / sfml-minesweeper

Custom minesweeper game built using SFML library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SFML Minesweeper

This is a version of the minesweeper game that I made on my own in order to practice using C++ classes and the SFML library.

For this game I tried to inspire myself on a 'beach' landscape instead of making your normal gray background simple af minesweeper, it also has a difficulty selector screen in order to change the size of the mine matrix that is being generated, as well as various sprites that are taken out of a same tileset texture, which makes reading the code good practice for learning the SFML library.

Feel free to download and modify the code as you wish.

It is currently only compiled for Windows as minesweeper.exe and for Ubuntu/Linux as minesweeper


Compiling on Ubuntu

To compile the code on ubuntu (and probably on other linux distros as well), you first must have installed the libsfml-dev package:

sudo apt install libsfml-dev

After that, you can compile the file minesweeper.cc as you would with any other SFML C++ file:

g++ minesweeper.cc -o minesweeper -lsfml-window -lsfml-system -lsfml-graphics

In this case, the program only needs the SFML graphics header file, but that also requires to include both the system and the window header files


Game preview

imagen

imagen

About

Custom minesweeper game built using SFML library


Languages

Language:C++ 100.0%