Fix the end ladder
This commit is contained in:
parent
9e099d0715
commit
d8d0bc6190
@ -208,8 +208,9 @@ class Generator:
|
||||
# place an exit ladder
|
||||
y, x = randint(0, height - 1), randint(0, width - 1)
|
||||
while level[y][x] != Tile.FLOOR or \
|
||||
any([t.is_wall() for t in Map.neighbourhood(level, y, x, large=True)]):
|
||||
any([level[j][i].is_wall() for j, i
|
||||
in Map.neighbourhood(level, y, x, large=True)]):
|
||||
y, x = randint(0, height - 1), randint(0, width - 1)
|
||||
level[sy][sx] = Tile.LADDER
|
||||
level[y][x] = Tile.LADDER
|
||||
|
||||
return Map(width, height, level, sy, sx)
|
||||
|
Loading…
Reference in New Issue
Block a user