From d6df43608501663fcdee341bb26b9eb5f79c37fb Mon Sep 17 00:00:00 2001 From: Anna Nowak Date: Mon, 25 Mar 2019 17:43:08 +0100 Subject: [PATCH] added additional condition for generating houses --- utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils.py b/utils.py index f066433..25aaef9 100644 --- a/utils.py +++ b/utils.py @@ -33,7 +33,7 @@ def generate_houses(all_sprites, obstacles_coords): while(home_counter != 0): x, y = generate_rand_coordinates( (PLAY_WIDTH//CELL_SIZE)-1, (PLAY_HEIGHT//CELL_SIZE)-1) - if(((x, y)) not in obstacles_coords["homes"] and ((x, y)) not in obstacles_coords["landfills"]): + if(((x, y)) not in obstacles_coords["homes"] and ((x, y)) not in obstacles_coords["landfills"] and ((x, y-1)) not in obstacles_coords["landfills"]): houses.append(House(x, y, 10, 10, 10)) obstacles_coords["homes"].append((x, y)) home_counter = home_counter - 1