From 2984427d2a88445b8388ffcafd94d1b4d7214ff7 Mon Sep 17 00:00:00 2001 From: chzhang Date: Sat, 12 Nov 2022 21:59:41 +0800 Subject: pygame Astar --- path_finding/astar.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'path_finding/astar.py') 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() -- cgit v1.2.3