3/4 repaired map-generating
This commit is contained in:
parent
7d13d98757
commit
c2149f9a9d
3
utils.py
3
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
|
||||
|
Loading…
Reference in New Issue
Block a user