3 import pygame.locals as pgl
5 from .base import BaseScene
6 from ..events import QuitEvent, SceneChangeEvent
9 class MenuScene(BaseScene):
10 def enter(self, gamestate):
11 if gamestate.station is None:
12 print "Loading Station Alpha ..."
13 gamestate.load_station("station-alpha.json")
15 def render(self, surface, gamestate):
16 surface.fill((0, 255, 0))
18 def event(self, ev, gamestate):
19 if ev.type == pgl.KEYDOWN:
20 if ev.key in (pgl.K_q, pgl.K_ESCAPE):
22 elif ev.key == pgl.K_n:
23 from .night import NightScene
24 SceneChangeEvent.post(scene=NightScene())
25 elif ev.key == pgl.K_d:
26 from .day import DayScene
27 SceneChangeEvent.post(scene=DayScene())
28 elif ev.key == pgl.K_l:
29 print "Loading Station Alpha ..."
30 gamestate.load_station("station-alpha.json")