X-Git-Url: https://git.ctpug.org.za/?a=blobdiff_plain;f=naja%2Fscenes%2Fwin.py;h=5acff6e5f8abde20029a5ffe21018e038c0d4f0d;hb=refs%2Fheads%2Ffeature%2F20140608-non-modal-controls;hp=cb3275deee85ac38a0b128a8f6bfc9dbdac683fa;hpb=66c8b68b5e0139e34258efa95e6a82e604a290e6;p=naja.git diff --git a/naja/scenes/win.py b/naja/scenes/win.py index cb3275d..5acff6e 100644 --- a/naja/scenes/win.py +++ b/naja/scenes/win.py @@ -5,7 +5,7 @@ Win scene. import pygame.locals as pgl from naja.constants import KEYS, PALETTE -from naja.events import SceneChangeEvent +from naja.events import SceneChangeEvent, LoadGameEvent from naja.sound import sound from naja.scenes.scene import Scene from naja.widgets.image_box import ImageBox @@ -24,25 +24,30 @@ class WinScene(Scene): (0, 0), "screens/you_won.png") self.add(background) + y_offset = 250 + if self.state.gameboard.has_cheated: self.add(TextWidget( - (50, 250), 'But you\'re a CHEATER!', colour=PALETTE.ORANGE)) + (50, y_offset), 'But you\'re a CHEATER!', colour=PALETTE.ORANGE)) + y_offset += 50 + self.add(TextBoxWidget( - (50, 300), '\n\n'.join([ + (50, y_offset), '\n\n'.join([ "You're great.", "You did well.", "You should be proud of yourself.", - "", "Press ESC to return to the menu", ]), colour=PALETTE.WHITE, padding=1, border=1, bg_colour=PALETTE.BLACK, border_colour=PALETTE.BLACK, box_width=300)) - sound.play_music('A_ninja.ogg') + sound.play_music('A_ninja.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: sound.stop() + # drop current state + LoadGameEvent.post(None) SceneChangeEvent.post(MenuScene) return