5 import pygame.locals as pgl
7 from naja.constants import KEYS, PALETTE
8 from naja.scenes.scene import Scene
9 from naja.widgets.image_box import ImageBox
10 from naja.widgets.text import TextWidget, TextBoxWidget
11 from naja.events import QuitGameEvent
14 class LoseScene(Scene):
19 def __init__(self, state):
20 super(LoseScene, self).__init__(state)
22 background = ImageBox(
23 (0, 0), "screens/you_lost.png")
28 (50, 50), 'You lost!', colour=PALETTE.WHITE))
29 self.add(TextBoxWidget(
30 (50, 100), '\n\n'.join([
31 "Something went terribly wrong.",
32 "You should re-evaluate your life choices.",
34 colour='white', padding=1, border=1,
35 bg_colour='black', border_colour='black',
38 def handle_scene_event(self, ev):
39 if ev.type == pgl.KEYDOWN and ev.key in KEYS.QUIT: