Implement method place_walls
This commit is contained in:
parent
ffa7641b21
commit
6fbc757f1e
@ -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"], \
|
||||
|
Loading…
Reference in New Issue
Block a user