diff --git a/02_dynamic_bsp_rooms.py b/02_dynamic_bsp_rooms.py index bd18e34..729029e 100644 --- a/02_dynamic_bsp_rooms.py +++ b/02_dynamic_bsp_rooms.py @@ -10,7 +10,7 @@ import random TILE_SIZE_X = 16 TILE_SIZE_Y = 16 -MIN_LEAF_SIZE = 7 +MIN_LEAF_SIZE = 8 class Leaf: @@ -71,8 +71,8 @@ class Leaf: def generate_room(self): x = random.randint(self.x+1, self.x+2) y = random.randint(self.y+1, self.y+2) - w = random.randint(3, self.width-1) - h = random.randint(3, self.height-1) + w = random.randint(MIN_LEAF_SIZE / 2, self.width - 2) + h = random.randint(MIN_LEAF_SIZE / 2, self.height - 2) return Room(x, y, w, h, self.id) def draw(self, ground):