użycie bfs w kodzie
This commit is contained in:
parent
936e0d7f4d
commit
71b2ecc23f
Binary file not shown.
4
main.py
4
main.py
@ -289,8 +289,8 @@ class Game:
|
|||||||
pygame.quit()
|
pygame.quit()
|
||||||
if event.type == pygame.KEYDOWN:
|
if event.type == pygame.KEYDOWN:
|
||||||
if event.key == pygame.K_SPACE:
|
if event.key == pygame.K_SPACE:
|
||||||
self.goal_pos = (self.flower.x//TILE_SIZE, self.flower.y//TILE_SIZE)
|
self.goal_cell = self.bfs.get_cell_number(self.flower.x, self.flower.y)
|
||||||
self.move_agent(self.astar.a_star(self.goal_pos))
|
self.move_agent(self.bfs.bfs(self.goal_cell))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user