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():
|
def check_for_exit():
|
||||||
for event in pygame.event.get():
|
for event in pygame.event.get():
|
||||||
if event.type == pygame.KEYDOWN and event.key in [pygame.K_ESCAPE, pygame.K_q]:
|
if event.type == pygame.KEYDOWN and event.key == pygame.K_ESCAPE:
|
||||||
exit_game()
|
return True
|
||||||
|
return False
|
||||||
pygame.event.pump()
|
pygame.event.pump()
|
||||||
|
|
||||||
def exit_game():
|
def exit_game():
|
||||||
|
Loading…
Reference in New Issue
Block a user