From: David Sharpe Date: Sun, 11 May 2014 16:58:38 +0000 (+0200) Subject: Fucking megres X-Git-Tag: 0.1~412 X-Git-Url: https://git.ctpug.org.za/?a=commitdiff_plain;h=0f233e6d450d863f06f5acddee3bd94f53594d08;p=naja.git Fucking megres --- 0f233e6d450d863f06f5acddee3bd94f53594d08 diff --cc naja/scenes/credits.py index cd3ad58,0000000..3f592df mode 100644,000000..100644 --- a/naja/scenes/credits.py +++ b/naja/scenes/credits.py @@@ -1,27 -1,0 +1,30 @@@ +""" +Main menu scene. +""" + +import pygame.locals as pgl + +from naja.scenes.scene import Scene +from naja.widgets.text import TextWidget +from naja.events import SceneChangeEvent + - +class CreditsScene(Scene): + + base_menu = None + + def __init__(self): + super(CreditsScene, self).__init__() - self.widgets.append(TextWidget((10, 10), 'Credits', - colour=(255, 255, 255))) ++ self.widgets.append(TextWidget((60, 10), 'Credits', fontsize=32, ++ colour='white')) ++ self.widgets.append(TextWidget((60, 30), ++ 'Your mom\n' ++ 'A stranger', fontsize=32, ++ colour='white')) + - def set_base_menu(self, base_menu): - self.base_menu = base_menu + + def handle_event(self, ev): + if ev.type == pgl.KEYUP and ev.key in (pgl.K_q, pgl.K_ESCAPE): - SceneChangeEvent.post(self.base_menu) ++ from naja.scenes.menu import MenuScene ++ menu_scene = MenuScene() ++ SceneChangeEvent.post(menu_scene) + return diff --cc naja/scenes/menu.py index b17f611,771cf33..96c8c7a --- a/naja/scenes/menu.py +++ b/naja/scenes/menu.py @@@ -24,6 -20,3 +21,7 @@@ class MenuScene(Scene) if ev.type == pgl.KEYUP and ev.key in (pgl.K_q, pgl.K_ESCAPE): QuitGameEvent.post() return + if ev.type == pgl.KEYUP and ev.key is pgl.K_RETURN: - SceneChangeEvent.post(self.credits_menu) ++ credits_menu = CreditsScene() ++ SceneChangeEvent.post(credits_menu) + return