Les sons du jeu classique #43
BIN
assets/sounds/lose_sound.wav
Normal file
BIN
assets/sounds/lose_sound.wav
Normal file
Binary file not shown.
BIN
assets/sounds/win_sound.wav
Normal file
BIN
assets/sounds/win_sound.wav
Normal file
Binary file not shown.
|
@ -15,6 +15,7 @@ from engine import (
|
|||
Order,
|
||||
Position,
|
||||
Scene,
|
||||
Sound,
|
||||
Text,
|
||||
TextSize,
|
||||
Texture,
|
||||
|
@ -167,6 +168,12 @@ def end_game(world: World, state: str):
|
|||
"""
|
||||
del world[IsRunning] # le jeu est fini.
|
||||
|
||||
# On joue le son
|
||||
if state == "Gagné":
|
||||
world.create_entity(Sound("win_sound.wav"))
|
||||
else:
|
||||
world.create_entity(Sound("lose_sound.wav"))
|
||||
|
||||
# On affiche le message de fin.
|
||||
for entity_text in world.query(TextDialogue):
|
||||
entity_text[Text] = Text(f"{state} !")
|
||||
|
|
Loading…
Reference in a new issue