from naja.scenes.scene import Scene
from naja.widgets.image_box import ImageBox
from naja.widgets.text import TextWidget, TextBoxWidget
-from naja.events import SceneChangeEvent
+from naja.events import SceneChangeEvent, LoadGameEvent
class LoseScene(Scene):
def handle_scene_event(self, ev):
from naja.scenes.menu import MenuScene
if ev.type == pgl.KEYDOWN and ev.key in KEYS.QUIT:
+ # drop current state
+ LoadGameEvent.post(None)
SceneChangeEvent.post(MenuScene)
return
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
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