list index fix

This commit is contained in:
Maciej Sobkowiak 2019-06-10 00:52:47 +02:00
parent 00e884422d
commit df807cc13a
3 changed files with 4 additions and 2 deletions

View File

@ -182,7 +182,7 @@ class Node:
self.col = col
self.field_type = field_type
self.house = House()
self.house.generate_trash()
#self.house.generate_trash()

View File

@ -68,6 +68,7 @@ class Window():
q[2].append(point)
elif point[0] >= 10 and point[1] >= 10:
q[3].append(point)
for ind, y in enumerate(q):
def dist(x,y):
return hypot(y[0]-x[0],y[1]-x[1])
@ -98,6 +99,7 @@ class Window():
self.grid.draw_node(self.screen, path[index-1][0],path[index-1][1])
self.grid.draw_node(self.screen, x, y)
pg.time.delay(500)
if(x != end[0] and y != end[1]):
print("collected:",grid.table[x][y].house.trash[2],"on possition: (",x,",",y,") ", grid.table[x][y].house.trash_file)