Compare commits
1 Commits
b479811a98
...
7cbbc64d27
| Author | SHA1 | Date | |
|---|---|---|---|
| 7cbbc64d27 |
+10
-1
@@ -818,7 +818,11 @@ def learn_sounds(sounds):
|
|||||||
str: "menu" if user exits with escape
|
str: "menu" if user exits with escape
|
||||||
"""
|
"""
|
||||||
loop = True
|
loop = True
|
||||||
|
try:
|
||||||
pygame.mixer.music.pause()
|
pygame.mixer.music.pause()
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
currentIndex = 0
|
currentIndex = 0
|
||||||
|
|
||||||
# Get list of available sounds, excluding special sounds
|
# Get list of available sounds, excluding special sounds
|
||||||
@@ -839,9 +843,14 @@ def learn_sounds(sounds):
|
|||||||
event = pygame.event.wait()
|
event = pygame.event.wait()
|
||||||
if event.type == pygame.KEYDOWN:
|
if event.type == pygame.KEYDOWN:
|
||||||
if event.key == pygame.K_ESCAPE:
|
if event.key == pygame.K_ESCAPE:
|
||||||
|
try:
|
||||||
|
pygame.mixer.music.unpause()
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
return "menu"
|
return "menu"
|
||||||
|
|
||||||
if event.key == [pygame.K_DOWN, pygame.K_s] and currentIndex < len(soundFiles) - 1:
|
if event.key in [pygame.K_DOWN, pygame.K_s] and currentIndex < len(soundFiles) - 1:
|
||||||
pygame.mixer.stop()
|
pygame.mixer.stop()
|
||||||
currentIndex += 1
|
currentIndex += 1
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user