Move keys to constants
[naja.git] / naja / scenes / credits.py
index f50d9e1cf178cb9873a04fd4e6101b53f9284204..67cb4e5a7045facdc7f20acf16d18f96a17c1b6e 100644 (file)
@@ -1,35 +1,38 @@
 """
-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, TextBoxWidget
 from naja.events import SceneChangeEvent
 
 
 class CreditsScene(Scene):
-
-    base_menu = None
+    """
+    List those responsible.
+    """
 
     def __init__(self, state):
         super(CreditsScene, self).__init__(state)
-        self.add(TextWidget((360, 160), 'Credits', fontsize=32,
-                            colour='white'))
-        self.add(TextBoxWidget((120, 30),
-                                       'Your mom '
-                                       'A stranger \n'
-                                       'A \n'
-                                       'bag full of snakes\n'
-                                       'A host of really bored bronies\n'
-                                       'And FIVE GOLDEN RIIIIINGS!', fontsize=32,
-                            colour='white', padding=1, border=1,
-                            bg_colour='black', border_colour='black',
-                            box_width=100))
+        self.add(TextWidget(
+            (480, 160), 'Credits', fontsize=32, colour='white'))
+        self.add(TextBoxWidget(
+            (120, 30), '\n'.join([
+                'Your mom A stranger',
+                'A',
+                'bag full of snakes',
+                'A host of really bored bronies',
+                'And FIVE GOLDEN RIIIIINGS!'
+            ]), fontsize=32,
+            colour='white', padding=1, border=1,
+            bg_colour='black', border_colour='black',
+            box_width=100))
 
     def handle_scene_event(self, ev):
-        if ev.type == pgl.KEYUP and ev.key in (pgl.K_q, pgl.K_ESCAPE):
+        if ev.type == pgl.KEYUP and ev.key in KEYS.QUIT:
             from naja.scenes.menu import MenuScene
             SceneChangeEvent.post(MenuScene)
             return