surfactants / sylph

C++/SFML ECS-based game engine
Other
0 stars 0 forks source link

Added New_Game state for world generation #4

Closed surfactants closed 1 year ago

surfactants commented 1 year ago

The new game menu now prepares and passes a New_Game_Data struct on clicking "Start".

The World class is instantiated here, and generates a set of tiles. Tiles are currently sf::ConvexShape cells, but a mode will certainly be added for regular square tiles. The cells were added to test the final addition, which is...

Voronoi diagrams. The Voronoi::Diagram class accepts a target point count, minimum position, and maximum position. The target is not reached if there is not enough space for the points. Spacing will be more flexible later - tighter spacing is a goal, but generation fails under those circumstances. Public functions are provided for returning the cells and the sites. (the latter is currently in RectangleShape form - later it will just be positions!)

also: