5 import pygame.locals as pgl
7 from naja.constants import KEYS, PALETTE
8 from naja.events import SceneChangeEvent
9 from naja.scenes.scene import Scene
10 from naja.widgets.image_box import ImageBox
11 from naja.widgets.text import TextWidget, TextBoxWidget
14 class WinScene(Scene):
19 def __init__(self, state):
20 super(WinScene, self).__init__(state)
22 background = ImageBox(
23 (0, 0), "screens/you_won.png")
26 if self.state.gameboard.has_cheated:
28 (50, 250), 'But you\'re a CHEATER!', colour=PALETTE.ORANGE))
29 self.add(TextBoxWidget(
30 (50, 300), '\n\n'.join([
33 "You should be proud of yourself.",
35 "Press ESC to return to the menu",
37 colour=PALETTE.WHITE, padding=1, border=1,
38 bg_colour=PALETTE.BLACK, border_colour=PALETTE.BLACK,
41 def handle_scene_event(self, ev):
42 from naja.scenes.menu import MenuScene
43 if ev.type == pgl.KEYDOWN and ev.key in KEYS.QUIT:
44 SceneChangeEvent.post(MenuScene)