diff --git a/03_map.py b/03_map.py index 2ce1993..d3fef95 100644 --- a/03_map.py +++ b/03_map.py @@ -144,7 +144,7 @@ class Level: def __init__(self, sizex, sizey, tile_file=None): self.sizex, self.sizey = sizex, sizey self.tileset = [] - self.tilemap = [[self.TILE_ROAD for y in range(0, sizey)] for x in range(0, sizex)] + self.tilemap = [] if tile_file: self.load_tileset(tile_file) self.tree = self.generate_tree() @@ -170,6 +170,9 @@ class Level: tree.append(l.left_leaf) tree.append(l.right_leaf) + #initialize tilemap with road/ground + self.tilemap = [[self.TILE_ROAD for y in range(0, self.sizey)] for x in range(0, self.sizex)] + # create rooms from partitions tree[0].generate_rooms(self.tilemap) return tree @@ -229,7 +232,8 @@ def on_key_press(symbol, modifiers): @window.event def on_draw(): window.clear() - level.draw_tree() + #level.draw_tree() + level.draw_map() label.draw()