win & lose return to main menu
[naja.git] / naja / scenes / win.py
index 8f52cc42562db689323a822c300e211be2e6767c..f8b42b32e63f49cd239d08177bc648ea8f4eac76 100644 (file)
@@ -5,7 +5,7 @@ Win scene.
 import pygame.locals as pgl
 
 from naja.constants import KEYS, PALETTE
-from naja.events import QuitGameEvent
+from naja.events import SceneChangeEvent
 from naja.scenes.scene import Scene
 from naja.widgets.image_box import ImageBox
 from naja.widgets.text import TextWidget, TextBoxWidget
@@ -23,21 +23,23 @@ class WinScene(Scene):
             (0, 0), "screens/you_won.png")
         self.add(background)
 
-        self.add(TextWidget((50, 50), 'You won!', colour=PALETTE.WHITE))
         if self.state.gameboard.has_cheated:
             self.add(TextWidget(
-                (50 + 64, 50), 'CHEATER!', colour=PALETTE.ORANGE))
+                (50, 250), 'But you\'re a CHEATER!', colour=PALETTE.ORANGE))
         self.add(TextBoxWidget(
-            (50, 100), '\n'.join([
+            (50, 300), '\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))
 
     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()
+            SceneChangeEvent.post(MenuScene)
             return