Compare commits
5 Commits
8bfe968b4b
...
2f791da5b7
Author | SHA1 | Date | |
---|---|---|---|
|
2f791da5b7 | ||
|
9997b684ca | ||
|
e7caff3d0f | ||
|
db6c34f714 | ||
|
3862b36d56 |
30
__init__.py
30
__init__.py
@@ -315,6 +315,36 @@ def play_bgm(music_file):
|
||||
except Exception as e:
|
||||
pass
|
||||
|
||||
def pause_game():
|
||||
"""Pauses the game"""
|
||||
speak("Game paused, press backspace to resume.")
|
||||
pygame.event.clear()
|
||||
try:
|
||||
pygame.mixer.pause()
|
||||
except:
|
||||
pass
|
||||
|
||||
try:
|
||||
pygame.mixer.music.pause()
|
||||
except:
|
||||
pass
|
||||
|
||||
while True:
|
||||
event = pygame.event.wait()
|
||||
if event.type == pygame.KEYDOWN and event.key == pygame.K_BACKSPACE: break
|
||||
|
||||
try:
|
||||
pygame.mixer.unpause()
|
||||
except:
|
||||
pass
|
||||
|
||||
try:
|
||||
pygame.mixer.music.unpause()
|
||||
except:
|
||||
pass
|
||||
|
||||
pygame.event.pump()
|
||||
|
||||
def get_input(prompt="Enter text:", text=""):
|
||||
"""Display a dialog box for text input.
|
||||
|
||||
|
Reference in New Issue
Block a user