This is much along the same lines as Gembit's remarkable game, "Eternal Tower" HERE:
and Polyphonic's random map generator HERE:
I've always wanted to write the code to a cavern maker where literally each wall is randomly placed and then checked to ensure that the areas around it can be reached.
And now you can ! Guarantees that all points can be reached despite the placement of the walls.
Change DEBUG in beginning to:
0 = Only draw completion
1 = Show the walls being drawn (default)
2 = Show the scanning process for each wall
Running into a bug, let me leave the stairs off for now. Should still run fine.
Got it fixed, should be alright now.
The randomly placed stairs leading up and down are considered FLOOR. That is, if you touch them, you can decide to take them or not. If I try to treat them as walls, they can get stuck in other walls.
Now my question is, can someone optimize this code so it runs considerably faster ?
Thanks, and enjoy !
[Please log in to post a comment]