diff options
| author | chzhang <zch921005@126.com> | 2022-11-12 21:59:41 +0800 |
|---|---|---|
| committer | chzhang <zch921005@126.com> | 2022-11-12 21:59:41 +0800 |
| commit | 2984427d2a88445b8388ffcafd94d1b4d7214ff7 (patch) | |
| tree | e3345f4cfd4f277848d5b5cfbc6f634b25cd4311 /path_finding/astar.py | |
| parent | a7c200f79b0e2df2defb74276fd416070b5a2ce9 (diff) | |
pygame Astar
Diffstat (limited to 'path_finding/astar.py')
| -rw-r--r-- | path_finding/astar.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/path_finding/astar.py b/path_finding/astar.py index f87f706..213a51b 100644 --- a/path_finding/astar.py +++ b/path_finding/astar.py @@ -1,6 +1,7 @@ import pygame import math from queue import PriorityQueue +import time WIDTH = 800 WIN = pygame.display.set_mode((WIDTH, WIDTH)) @@ -115,6 +116,7 @@ def algorithm(draw, grid, start, end): open_set_hash = {start} while not open_set.empty(): + for event in pygame.event.get(): if event.type == pygame.QUIT: pygame.quit() |
