użycie bfs w kodzie

This commit is contained in:
Weranda 2023-06-16 12:59:42 +02:00
parent 936e0d7f4d
commit 71b2ecc23f
2 changed files with 2 additions and 2 deletions

Binary file not shown.

View File

@ -289,8 +289,8 @@ class Game:
pygame.quit()
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_SPACE:
self.goal_pos = (self.flower.x//TILE_SIZE, self.flower.y//TILE_SIZE)
self.move_agent(self.astar.a_star(self.goal_pos))
self.goal_cell = self.bfs.get_cell_number(self.flower.x, self.flower.y)
self.move_agent(self.bfs.bfs(self.goal_cell))