Improved check_for_exit function.

This commit is contained in:
Storm Dragon 2024-07-16 14:22:36 -04:00
parent 38522aee78
commit df386cbbd9

View File

@ -126,8 +126,9 @@ def speak(text, interupt = True):
def check_for_exit():
for event in pygame.event.get():
if event.type == pygame.KEYDOWN and event.key in [pygame.K_ESCAPE, pygame.K_q]:
exit_game()
if event.type == pygame.KEYDOWN and event.key == pygame.K_ESCAPE:
return True
return False
pygame.event.pump()
def exit_game():