diff --git a/squirrelbattle/mapgeneration/broguelike.py b/squirrelbattle/mapgeneration/broguelike.py index 012a577..17fd3b8 100644 --- a/squirrelbattle/mapgeneration/broguelike.py +++ b/squirrelbattle/mapgeneration/broguelike.py @@ -489,7 +489,6 @@ class Generator: tries += 1 # post-processing - self.place_walls(level) # because when a room is placed, it leads to exactly one previously # placed room, the level has a tree like structure with the starting @@ -500,9 +499,13 @@ class Generator: while tries < self.params["loop_tries"] and \ loops < self.params["loop_max"]: tries += 1 + print(tries) y, x = randint(0, height - 1), randint(0, width - 1) loops += self.add_loop(level, y, x) + # surround the floor with walls + self.place_walls(level) + # place an exit ladder y, x = randint(0, height - 1), randint(0, width - 1) while level[y][x] != Tile.FLOOR or \