Playtesting credits
[naja.git] / naja / scenes / credits.py
index 46c076f487ce65ade92b76cff8e429e6f24e4b5c..9bb6d89494fcb00e08018b6b3631c376a1f3eb24 100644 (file)
@@ -1,29 +1,61 @@
+# coding: UTF-8
 """
-Main menu scene.
+Credits scene.
 """
 
 import pygame.locals as pgl
 
+from naja.constants import KEYS
 from naja.scenes.scene import Scene
-from naja.widgets.text import TextWidget
+from naja.widgets.text import TextWidget, TextBoxWidget
+from naja.widgets.image_box import ImageBox
 from naja.events import SceneChangeEvent
 
 
 class CreditsScene(Scene):
+    """
+    List those responsible.
+    """
 
-    base_menu = None
+    def __init__(self, state):
+        super(CreditsScene, self).__init__(state)
 
-    def __init__(self):
-        super(CreditsScene, self).__init__()
-        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'))
+        background = ImageBox(
+            (0, 0), "screens/splash.png")
+        self.add(background)
+        self.add(TextWidget(
+            (400, 300), 'CREDITS', colour='white', centre=True))
 
-    def handle_event(self, ev):
-        if ev.type == pgl.KEYUP and ev.key in (pgl.K_q, pgl.K_ESCAPE):
+        self.add(TextBoxWidget(
+            (400, 340), '\n'.join([
+                'A game about robots and bits and other things',
+                '',
+                'by',
+                '',
+                u'Adrianna PiƄska, David Sharpe, Jeremy Thurgood, '
+                u'Neil Muller, Simon Cross & Stefano Rivera',
+                '',
+                'Special thanks to:',
+                '',
+                'Desilu Crossman',
+                'for snacks and tutorial inspiration',
+                '',
+                'Bearnard Hibbins, Graham Inggs,',
+                'and William Stewart',
+                'for playtesting and finding bugs',
+                '',
+                'Music by Rolemusic:',
+                'http://rolemusic.sawsquarenoise.com/',
+                '',
+                'Out of credits. Insert coin.',
+                '(Press ESC to return to the menu.)',
+            ]),
+            colour='white', padding=1,
+            bg_colour=(0, 0, 0, 0), centre=True,
+            box_width=780, view_port=(780, 250)))
+
+    def handle_scene_event(self, ev):
+        if ev.type == pgl.KEYDOWN and ev.key in KEYS.QUIT:
             from naja.scenes.menu import MenuScene
             SceneChangeEvent.post(MenuScene)
             return