3/4 repaired map-generating

This commit is contained in:
Anna Nowak 2019-03-25 14:07:25 +01:00
parent 7d13d98757
commit c2149f9a9d

View File

@ -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