A simple Minesweeper clone written in C++ using SFML. This project demonstrates how to create a graphical user interface with interactive buttons, windows, and more.
- Graphical Interface: Uses SFML for drawing windows, buttons, and text.
- Customizable: You can adjust the window size and number of mines in the source code.
- Cross-Platform: CMake + SFML allows the game to be built on Windows, macOS, and Linux.
-
A C++11 (or higher) compatible compiler (e.g., gcc, clang, MSVC).
-
CMake 3.2 or higher.
-
SFML 2.5.1 (or newer).
- You can install SFML from:
- SFML official website
- A package manager (e.g., vcpkg, Conan, homebrew, apt, etc.)
- Or build SFML from source.
- You can install SFML from:
-
Clone this repository:
git clone https://github.com/<YOUR_USERNAME>/Minesweeper.git cd Minesweeper
-
Install SFML If you haven’t already. Make sure SFML is accessible to CMake (for example, via
SFML_DIRor a standard system path). -
Generate build files with CMake:
cmake -B build -S . -
Build the project:
cmake --build build
-
Run the game:
- On macOS/Linux:
./build/untitled
- On Windows
.\build\Debug\untitled.exe
- On macOS/Linux:
- Left-click on a tile to reveal it.
- Right-click to place/remove flags.
- The goal is to reveal all non-mine tiles without triggering a mine.