import pygame.locals as pgl
from .base import BaseScene
-from ..events import QuitEvent
+from ..events import QuitEvent, SceneChangeEvent
class MenuScene(BaseScene):
+ def render(self, surface, gamestate):
+ surface.fill((0, 255, 0))
+
def event(self, ev, gamestate):
if ev.type == pgl.KEYDOWN:
if ev.key in (pgl.K_q, pgl.K_ESCAPE):
QuitEvent.post()
+ elif ev.key == pgl.K_n:
+ from .night import NightScene
+ SceneChangeEvent.post(scene=NightScene())
+""" In the night, the mould attacks. """
+
+import pygame.event
+import pygame.locals as pgl
+
+from .base import BaseScene
+from ..events import SceneChangeEvent
+
+
+class NightScene(BaseScene):
+ def render(self, surface, gamestate):
+ surface.fill((0, 0, 255))
+
+ def event(self, ev, gamestate):
+ if ev.type == pgl.KEYDOWN:
+ if ev.key in (pgl.K_q, pgl.K_ESCAPE):
+ from .menu import MenuScene
+ SceneChangeEvent.post(scene=MenuScene())