from naja.scenes.scene import Scene
from naja.widgets.image_box import ImageBox
from naja.widgets.text import TextWidget, TextBoxWidget
-from naja.events import QuitGameEvent
+from naja.events import SceneChangeEvent
class LoseScene(Scene):
(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))
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
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
"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