X-Git-Url: https://git.ctpug.org.za/?a=blobdiff_plain;f=naja%2Fscenes%2Flose.py;h=714eaf6f8aa5c7a6fc4d635b16bd53d1657f362d;hb=db18631120e34670b9f8be526f5b7d5938e1d7fc;hp=6fe9b4f36aabe2a79bfdfcac77cb64c3d29c5c9d;hpb=5c5fab67d38568608d39d21f48268f35e7d8b81e;p=naja.git diff --git a/naja/scenes/lose.py b/naja/scenes/lose.py index 6fe9b4f..714eaf6 100644 --- a/naja/scenes/lose.py +++ b/naja/scenes/lose.py @@ -6,9 +6,10 @@ import pygame.locals as pgl from naja.constants import KEYS, PALETTE from naja.scenes.scene import Scene +from naja.sound import sound from naja.widgets.image_box import ImageBox from naja.widgets.text import TextWidget, TextBoxWidget -from naja.events import QuitGameEvent +from naja.events import SceneChangeEvent, LoadGameEvent class LoseScene(Scene): @@ -35,12 +36,19 @@ class LoseScene(Scene): (50, 300), '\n\n'.join([ "Something went terribly wrong.", "You should re-evaluate your life choices.", + "", + "Press ESC to return to the menu", ]), fontsize=32, colour='white', padding=1, border=1, bg_colour='black', border_colour='black', box_width=300)) + sound.play_music('lost.ogg', 0.25) def handle_scene_event(self, ev): + from naja.scenes.menu import MenuScene if ev.type == pgl.KEYDOWN and ev.key in KEYS.QUIT: - QuitGameEvent.post() + sound.stop() + # drop current state + LoadGameEvent.post(None) + SceneChangeEvent.post(MenuScene) return