Last time we added path finding and now we need to expand the world so we have something to navigate. We start with a simple way to add more than just one room.
The algorithm is pretty simple and error prone, but seems to work okish for now. We have a 150x150 tile world, and populate it with a random number of rooms. For each room we randomize the width, height, and position in the world. If it overlaps with a previously created room we retry a couple of times before we give up and move to the next room.
That’s basically it. The image above shows what a random generation can look like. Next post will be a bit longer and talk about how we connect the different rooms together with tunnels.