Slay tutorial three published

Onslaught mapThis is a typical map produced by the generator. One large continent with coloured hexagons from 8 players arranged in clumps and individual hexes. It’s not quite perfect- in the top right corner there is a single blue hex but its not bad.

I’ve just published Slay tutorial three with the source code in the file onslaught2.zip on GitHub. I’m quite pleased with the map generator which is based on the one I devised for Empire and which I covered in an earlier blog post.  It does a lot and quick enough that when you press the N key it can generate a new map in a fraction of a second.  C + SDL2 is very fast even when drawing nearly a thousand hexagons every frame. It’s mostly in just one file (for now) with timing code and a data file for generating maps in separate files. The main file is just over 600 lines long.

As it needed a fair bit of debugging, I made it cross-compile in Windows or Linux (and probably Mac OS but that’s not tested). You can load the solution file in Windows with Visual Studio or put the files into a Folder with Visual Studio Code on Linux. Included in the zip file is the assets folder which has all the individual hex graphics and a .vscode folder with JSO files for doing the build with clang on Linux.  I’ve compiled it and run on both Windows and Linux. The SDL2 Window is 1300 x 768 pixels wide.

(Visited 17 times, 1 visits today)