diff --git a/__pycache__/bfs.cpython-310.pyc b/__pycache__/bfs.cpython-310.pyc index 6060d9a..e8f00ed 100644 Binary files a/__pycache__/bfs.cpython-310.pyc and b/__pycache__/bfs.cpython-310.pyc differ diff --git a/main.py b/main.py index 2e73a3c..e92d1ff 100644 --- a/main.py +++ b/main.py @@ -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))