Moved audio files in seperate directory and changed code accordingly
This commit is contained in:
8
game.py
8
game.py
@@ -452,7 +452,7 @@ class TimeGuessGame:
|
|||||||
self.status_label.config(text="Bereit zum Start") # Klarerer Status
|
self.status_label.config(text="Bereit zum Start") # Klarerer Status
|
||||||
|
|
||||||
elif message == "TIME_STARTED":
|
elif message == "TIME_STARTED":
|
||||||
startsound = pygame.mixer.Sound("start.mp3") # Start-Sound setzen
|
startsound = pygame.mixer.Sound("resources/audio/start.mp3") # Start-Sound setzen
|
||||||
pygame.mixer.Sound.play(startsound) # Start-Sound abspielen
|
pygame.mixer.Sound.play(startsound) # Start-Sound abspielen
|
||||||
|
|
||||||
self.status_label.config(text="Zeitmessung läuft...")
|
self.status_label.config(text="Zeitmessung läuft...")
|
||||||
@@ -482,13 +482,13 @@ class TimeGuessGame:
|
|||||||
|
|
||||||
# Sound-Ausgabe, je nach Zeitabweichung
|
# Sound-Ausgabe, je nach Zeitabweichung
|
||||||
if deviation_abs_sec >= 10:
|
if deviation_abs_sec >= 10:
|
||||||
fail = pygame.mixer.Sound("fail.mp3")
|
fail = pygame.mixer.Sound("resources/audio/fail.mp3")
|
||||||
pygame.mixer.Sound.play(fail)
|
pygame.mixer.Sound.play(fail)
|
||||||
elif deviation_abs_sec == 0:
|
elif deviation_abs_sec == 0:
|
||||||
winner = pygame.mixer.Sound("winner.mp3")
|
winner = pygame.mixer.Sound("resources/audio/winner.mp3")
|
||||||
pygame.mixer.Sound.play(winner)
|
pygame.mixer.Sound.play(winner)
|
||||||
else:
|
else:
|
||||||
fail = pygame.mixer.Sound("good.mp3")
|
fail = pygame.mixer.Sound("resources/audio/good.mp3")
|
||||||
pygame.mixer.Sound.play(fail)
|
pygame.mixer.Sound.play(fail)
|
||||||
|
|
||||||
elif message == "GAME_ENDED":
|
elif message == "GAME_ENDED":
|
||||||
|
|||||||
Reference in New Issue
Block a user