X-Git-Url: https://git.ctpug.org.za/?a=blobdiff_plain;f=naja%2Fscenes%2Flose.py;h=7455fdf60387ad39529151ecbc33b117795b6394;hb=a12dd14b0afd356c09480a2b5b2b82e9c35425be;hp=40600a7c21dff4d2012ade0e8e73a2b7fa29c762;hpb=52ea2942029fb4bb33d17e19ba2919607c234e8f;p=naja.git diff --git a/naja/scenes/lose.py b/naja/scenes/lose.py index 40600a7..7455fdf 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): @@ -23,19 +24,27 @@ class LoseScene(Scene): (0, 0), "screens/you_lost.png") self.add(background) + if self.state.gameboard.has_cheated: + self.add(TextWidget( + (50, 250), 'Even with cheats on.', colour=PALETTE.ORANGE)) - self.add(TextWidget( - (50, 50), 'You lost!', colour=PALETTE.WHITE)) self.add(TextBoxWidget( - (50, 100), '\n\n'.join([ + (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