X-Git-Url: https://git.ctpug.org.za/?a=blobdiff_plain;f=naja%2Fscenes%2Fcredits.py;h=a522c986c1207ba6a97e7e84bac9bb56475eaabe;hb=ff24720437195d52b96dbd4e76a49b78881d3378;hp=05e2f7d3ddf94fba577258a3a294617c47d4986e;hpb=e84353ad1fdf7551807424ab20c138db333684fc;p=naja.git diff --git a/naja/scenes/credits.py b/naja/scenes/credits.py index 05e2f7d..a522c98 100644 --- a/naja/scenes/credits.py +++ b/naja/scenes/credits.py @@ -1,30 +1,57 @@ +# 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, TextBoxWidget +from naja.widgets.image_box import ImageBox from naja.events import SceneChangeEvent -class CreditsScene(Scene): - base_menu = None +class CreditsScene(Scene): + """ + List those responsible. + """ def __init__(self, state): super(CreditsScene, self).__init__(state) - self.widgets.append(TextWidget((120, 120), 'Credits', fontsize=32, - colour='white')) - self.widgets.append(TextBoxWidget((120, 30), - 'Your mom ' - 'A stranger \nA \nbag full of snakes', fontsize=32, - colour='white', padding=1, border=1, - bg_colour='black', border_colour='black', - box_width=100)) - - def handle_event(self, ev): - if ev.type == pgl.KEYUP and ev.key in (pgl.K_q, pgl.K_ESCAPE): + + background = ImageBox( + (0, 0), "screens/splash.png") + self.add(background) + self.add(TextWidget( + (400, 300), 'CREDITS', colour='white', centre=True)) + + 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', + '', + '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