Implement method place_walls

This commit is contained in:
Charles Peyrat 2021-01-08 04:43:10 +01:00
parent ffa7641b21
commit 6fbc757f1e
1 changed files with 11 additions and 0 deletions

View File

@ -52,6 +52,17 @@ class Generator:
for rx in range(rw):
if room[y][x] == Tile.FLOOR:
level[y-door_y][y-door_x] = Tile.FLOOR
@staticmethod
def place_walls(level):
h, w = len(level), len(level[0])
for y in range(h):
for x in range(w):
if level[y][x] == Tile.FLOOR:
for dy, dx in Map.neighbourhood(level, y, x):
if level[y+dy][x+dx] == Tile.EMPTY:
level[y+dy][x+dx] = Tile.FLOOR
def corr_meta_info(self):
if random() < self.params["corridor_chance"]:
h_sup = randint(self.params["min_h_corr"], \