seuchomat.org

RetroSweeper - a classical MineSweeper clone using C++ and SDL2


A few days ago I decided I wanted to polish my resume as C++ programmer by doing some pet projects. One of those projects was re-creating an Minesweeper clone. I decided to keep it easy and implemented just the basic game logic and a simple state pattern. My goal was to get something done and to try out new things therefore I used the 4Coder Editor on my Lenovo ThinkPad X250 to create it. For the graphics I used SDL2, SDL_Image and SDL_TTF with SDL_FontCache as wrapper library.

I used MSVC (Windows 10), G++ (Linux) and clang (OSX) as compilers. I disliked the experience of using CMake on Windows because library management is still crappy on that platform. However, it worked without any problems on the other platforms. I drew the sprites myself and used the "Early Gameboy" true type font. You will find an screenshot below.

Feel free to download the Windows 10 build here.

If you want to have a look at the rather unoptimized code, check out the Github repo. The approach I used to create the game was to keep it rather simple to get some actual work done. Therefore there is much optimization left to do. For example, I would like to clean up the GUI stuff and make it widget-based. The input management should be extracted from the Minesweeper class. The game state management should also be extracted. Constants should be used. Overall, as I only took about 6 hours of time, I am rather happy with the result.