C++ Random Map Generation
![MapCombind.png](https://static.wixstatic.com/media/768c5a_0e9adb7c67ac4116978dfb233955293f~mv2.png/v1/fill/w_980,h_357,al_c,q_85,usm_0.66_1.00_0.01,enc_avif,quality_auto/768c5a_0e9adb7c67ac4116978dfb233955293f~mv2.png)
Summary
This was a simple project to learn the ropes of C++. I wanted to see if I could create a 2D random map generator, I had made a map generator before in Unity so I had some experience creating a system like this before, but since I didn't have an engine to rely upon I made a tile map system to accomplish my goal.
In order to get the map to draw I needed a library that could do that, I knew about a library by the name of raylib because I used it in the past for some assignments in my diploma course.
Tile Map System
The tile mad class is very simple overall as it only needs to hold five variables. Two of the variables are just the height and width of the map and the other three are to do with the tiles them selves, controlling both the height and width of the tiles in pixels and a 2D vector of Tile classes.
The Tile class is also very simple, it just need to know about its scale and its colour to draw.
The tile map is also allowed to change at run time using the SetTile function.
![TileMapConstuctors.PNG](https://static.wixstatic.com/media/768c5a_fec7fb15b2334bbeb197db8c849c7231~mv2.png/v1/fill/w_419,h_392,al_c,q_85,usm_0.66_1.00_0.01,enc_avif,quality_auto/TileMapConstuctors_PNG.png)
The Walkers
The Walkers are the main part of random generation in this project. A walker has a pointer to a tile map that it needs to edit and a colour to set a tile to.
The walkers can move in four directions up, down, left, and right. they decide on what direction to go based on random chance each time they move a tile.
![Walker constructor.PNG](https://static.wixstatic.com/media/768c5a_3e450becb0cc4afcb6520f8d6051a160~mv2.png/v1/fill/w_362,h_308,al_c,q_85,usm_0.66_1.00_0.01,enc_avif,quality_auto/Walker%20constructor_PNG.png)
![Walker move code.PNG](https://static.wixstatic.com/media/768c5a_78cd4978e546431d8da00759ca27103a~mv2.png/v1/fill/w_231,h_362,al_c,q_85,usm_0.66_1.00_0.01,enc_avif,quality_auto/Walker%20move%20code_PNG.png)