Drop state when the game is over (after we've found out if we're cheating or not)
[naja.git] / naja / scenes / win.py
index cb3275deee85ac38a0b128a8f6bfc9dbdac683fa..59efdb917c37b63a19db3f205279e274c52eac0f 100644 (file)
@@ -5,7 +5,7 @@ Win scene.
 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
@@ -44,5 +44,7 @@ class WinScene(Scene):
         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