Re: Random Dungeon generator?
I'm actually quite impressed! It's not the most readable code in the world, but I would have thought that generating a random dungeon would take a lot more than that. It's the kind of thing that's certainly easier in text-based language because of the large amount of variables you have to manipulate along the way, but I don't see any reason why it couldn't be put into a fastloop and made to run on an array, then that array looped through and displayed.
(There is one bug - it seems the line reading "if (xsize < xmax) System.out.print("\n");" should be "if (y < ysize) System.out.print("\n");".)
Re: Random Dungeon generator?
I dont understand how I coud put that in a fastloop and make it run on an array....
Re: Random Dungeon generator?
Quote:
Originally Posted by DavidN
I'm actually quite impressed!
http://roguebasin.roguelikedevelopment.org/index.php?title=Java_Example_of_Dungeon-Building_Algorithm
Re: Random Dungeon generator?
I'm significantly less impressed!
Re: Random Dungeon generator?
Ok thats where i found it......couldnt remember
Re: Random Dungeon generator?
Anyway.....how could I test if a 16x16 square is adjacent(left,right,up,down)to a selected block. I picked one block at random, set its AS1 to "visited"(the rest are "unvisited"); I need to select a random direction,set the adjacent block to "visited", and change the previous block to "finished". All I can do is select the random block and set it to visited. Can anybody help?
Im basing my formula on http://www.aarg.net/~minam/dungeon_design.html