We set defaults in new_game() don't pass parameters that aren't needed
[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                 'Music by Rolemusic:',
39                 'http://rolemusic.sawsquarenoise.com/',
40                 '',
41                 'Press ESC to return to the menu.',
42             ]),
43             colour='white', padding=1,
44             bg_colour=(0, 0, 0, 0), centre=True,
45             box_width=780, view_port=(780, 250)))
46
47     def handle_scene_event(self, ev):
48         if ev.type == pgl.KEYDOWN and ev.key in KEYS.QUIT:
49             from naja.scenes.menu import MenuScene
50             SceneChangeEvent.post(MenuScene)
51             return