Playtesting 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                 'Bearnard Hibbins, Graham Inggs,',
44                 'and William Stewart',
45                 'for playtesting and finding bugs',
46                 '',
47                 'Music by Rolemusic:',
48                 'http://rolemusic.sawsquarenoise.com/',
49                 '',
50                 'Out of credits. Insert coin.',
51                 '(Press ESC to return to the menu.)',
52             ]),
53             colour='white', padding=1,
54             bg_colour=(0, 0, 0, 0), centre=True,
55             box_width=780, view_port=(780, 250)))
56
57     def handle_scene_event(self, ev):
58         if ev.type == pgl.KEYDOWN and ev.key in KEYS.QUIT:
59             from naja.scenes.menu import MenuScene
60             SceneChangeEvent.post(MenuScene)
61             return