One more addition to pause.

This commit is contained in:
Storm Dragon 2025-02-16 17:23:19 -05:00
parent 9997b684ca
commit 2f791da5b7

View File

@ -318,6 +318,7 @@ def play_bgm(music_file):
def pause_game():
"""Pauses the game"""
speak("Game paused, press backspace to resume.")
pygame.event.clear()
try:
pygame.mixer.pause()
except:
@ -331,6 +332,7 @@ def pause_game():
while True:
event = pygame.event.wait()
if event.type == pygame.KEYDOWN and event.key == pygame.K_BACKSPACE: break
try:
pygame.mixer.unpause()
except:
@ -341,6 +343,8 @@ def pause_game():
except:
pass
pygame.event.pump()
def get_input(prompt="Enter text:", text=""):
"""Display a dialog box for text input.