Update scene changing.
authorSimon Cross <hodgestar@gmail.com>
Sun, 11 May 2014 17:06:05 +0000 (19:06 +0200)
committerSimon Cross <hodgestar@gmail.com>
Sun, 11 May 2014 17:08:30 +0000 (19:08 +0200)
naja/scenes/credits.py
naja/scenes/game.py
naja/scenes/menu.py

index 3f592df886d4e47cba49c431c61401e448aadc7f..46c076f487ce65ade92b76cff8e429e6f24e4b5c 100644 (file)
@@ -8,6 +8,7 @@ from naja.scenes.scene import Scene
 from naja.widgets.text import TextWidget
 from naja.events import SceneChangeEvent
 
+
 class CreditsScene(Scene):
 
     base_menu = None
@@ -21,10 +22,8 @@ class CreditsScene(Scene):
                                        'A stranger', fontsize=32,
                             colour='white'))
 
-
     def handle_event(self, ev):
         if ev.type == pgl.KEYUP and ev.key in (pgl.K_q, pgl.K_ESCAPE):
             from naja.scenes.menu import MenuScene
-            menu_scene = MenuScene()
-            SceneChangeEvent.post(menu_scene)
+            SceneChangeEvent.post(MenuScene)
             return
index 48625007fb34934711ce4cd497567987f8c383fe..d6d558c068668503591f9cb1c4ec481b895e684d 100644 (file)
@@ -29,5 +29,5 @@ class GameScene(Scene):
 
     def handle_event(self, ev):
         if ev.type == pgl.KEYUP and ev.key in (pgl.K_q, pgl.K_ESCAPE):
-            SceneChangeEvent.post(scene=MenuScene())
+            SceneChangeEvent.post(MenuScene)
             return
index c2e9a164ceef9edda02553242ba768743f769654..6819810be1e5d253fdca03baefb9505e825cb634 100644 (file)
@@ -27,6 +27,5 @@ class MenuScene(Scene):
             QuitGameEvent.post()
             return
         if ev.type == pgl.KEYDOWN and ev.key is pgl.K_RETURN:
-            credits_menu = CreditsScene()
-            SceneChangeEvent.post(credits_menu)
+            SceneChangeEvent.post(CreditsScene)
             return