Improved check_for_exit function.
This commit is contained in:
parent
38522aee78
commit
df386cbbd9
@ -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():
|
||||
|
Loading…
Reference in New Issue
Block a user