--- /dev/null
-
+"""
+Main menu scene.
+"""
+
+import pygame.locals as pgl
+
+from naja.scenes.scene import Scene
+from naja.widgets.text import TextWidget
+from naja.events import SceneChangeEvent
+
- self.widgets.append(TextWidget((10, 10), 'Credits',
- colour=(255, 255, 255)))
+class CreditsScene(Scene):
+
+ base_menu = None
+
+ def __init__(self):
+ super(CreditsScene, self).__init__()
- def set_base_menu(self, base_menu):
- self.base_menu = base_menu
++ self.widgets.append(TextWidget((60, 10), 'Credits', fontsize=32,
++ colour='white'))
++ self.widgets.append(TextWidget((60, 30),
++ 'Your mom\n'
++ 'A stranger', fontsize=32,
++ colour='white'))
+
- SceneChangeEvent.post(self.base_menu)
+
+ 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)
+ return
if ev.type == pgl.KEYUP and ev.key in (pgl.K_q, pgl.K_ESCAPE):
QuitGameEvent.post()
return
- SceneChangeEvent.post(self.credits_menu)
+ if ev.type == pgl.KEYUP and ev.key is pgl.K_RETURN:
++ credits_menu = CreditsScene()
++ SceneChangeEvent.post(credits_menu)
+ return