Fix typos

This commit is contained in:
Charles Peyrat 2021-01-08 05:14:46 +01:00
parent abbad0f352
commit 49e261557c
1 changed files with 3 additions and 4 deletions

View File

@ -23,7 +23,6 @@ DEFAULT_PARAMS = {
"circular_holes" : .5,
}
class Generator:
def __init__(self, params: dict = DEFAULT_PARAMS):
self.params = params
@ -89,7 +88,7 @@ class Generator:
dx = -1 if random() < .5 else 1
yxs = [i for i in range(len(room) * len(room[0]))]
shuffle(xys)
shuffle(yxs)
for pos in yxs:
y, x = pos // len(room), pos % len(room)
if room[y][x] == Tile.EMPTY:
@ -131,9 +130,9 @@ class Generator:
else:
room[-1].append(Tile.EMPTY)
door_y, door_x, dy, dx = self.attach_doors(room, h_sup, w_sup, h_off, w_off)
door_y, door_x, dy, dx = self.attach_door(room, h_sup, w_sup, h_off, w_off)
return room, doory, doorx, dy, dx
return room, door_y, door_x, dy, dx
def create_random_room(self):
return self.create_circular_room()