From c2149f9a9d5fa61db0cf56004d8491e17142bf6c Mon Sep 17 00:00:00 2001 From: Anna Nowak Date: Mon, 25 Mar 2019 14:07:25 +0100 Subject: [PATCH] 3/4 repaired map-generating --- utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils.py b/utils.py index 590a4da..2cdb777 100644 --- a/utils.py +++ b/utils.py @@ -40,7 +40,8 @@ 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) or (x,y-1)) not in obstacles_coords): + if(((x, y) or (x+1,y)) not in obstacles_coords): + print(x,y) houses.append(House(x, y, 10, 10, 10)) obstacles_coords.append((x, y)) home_counter = home_counter - 1