Playing with maze gen again.
This commit is contained in:
parent
c97648ab3a
commit
33cd490ed3
8 changed files with 164 additions and 36 deletions
|
@ -14,13 +14,8 @@ void WorldBuilder::generate_map() {
|
|||
// run it once to find dead ends
|
||||
maze::hunt_and_kill($map.$walls, $map.$rooms, $map.$dead_ends);
|
||||
|
||||
// use those dead ends to randomly place rooms
|
||||
for(auto at : $map.$dead_ends) {
|
||||
if(Random::uniform(0,1)) {
|
||||
Room cur{at.x, at.y, 2, 2};
|
||||
$map.add_room(cur);
|
||||
}
|
||||
}
|
||||
// randomize rooms based on dead ends
|
||||
maze::randomize_rooms($map.$rooms, $map.$dead_ends);
|
||||
|
||||
// run it again to create the final map with rooms
|
||||
// NOTE: hund_and_kill is responsible for clearing the map correctly
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue