Out of credits.
[naja.git] / naja / scenes / credits.py
1 # coding: UTF-8
2 """
3 Credits scene.
4 """
5
6 import pygame.locals as pgl
7
8 from naja.constants import KEYS
9 from naja.scenes.scene import Scene
10 from naja.widgets.text import TextWidget, TextBoxWidget
11 from naja.widgets.image_box import ImageBox
12 from naja.events import SceneChangeEvent
13
14
15 class CreditsScene(Scene):
16     """
17     List those responsible.
18     """
19
20     def __init__(self, state):
21         super(CreditsScene, self).__init__(state)
22
23         background = ImageBox(
24             (0, 0), "screens/splash.png")
25         self.add(background)
26         self.add(TextWidget(
27             (400, 300), 'CREDITS', colour='white', centre=True))
28
29         self.add(TextBoxWidget(
30             (400, 340), '\n'.join([
31                 'A game about robots and bits and other things',
32                 '',
33                 'by',
34                 '',
35                 u'Adrianna PiƄska, David Sharpe, Jeremy Thurgood, '
36                 u'Neil Muller, Simon Cross & Stefano Rivera',
37                 '',
38                 'Special thanks to:',
39                 '',
40                 'Desilu Crossman',
41                 'for snacks and tutorial inspiration',
42                 '',
43                 'Music by Rolemusic:',
44                 'http://rolemusic.sawsquarenoise.com/',
45                 '',
46                 'Out of credits. Insert coin.',
47                 '(Press ESC to return to the menu.)',
48             ]),
49             colour='white', padding=1,
50             bg_colour=(0, 0, 0, 0), centre=True,
51             box_width=780, view_port=(780, 250)))
52
53     def handle_scene_event(self, ev):
54         if ev.type == pgl.KEYDOWN and ev.key in KEYS.QUIT:
55             from naja.scenes.menu import MenuScene
56             SceneChangeEvent.post(MenuScene)
57             return