I continue work on my new Level Generator for my game. It was working pretty well, up until I developed an infinite loop, which is never a good thing.
I’ve spent today working through the cause of the loop. It’s because the SpawnRoom function only spawns rooms if “roomsSpawned IS LESS THAN numRoomsInLevel“. But “roomsSpawned EQUALS numRoomsInLevel” by the time I’m trying to spawn additional treasure rooms, meaning no treasure rooms get spawned and we’re stuck in an infinite loop.