@property
def turnip_target(self):
return self._state["station"]["config"]["turnip target"]
+
+ def update_lights(self, lights):
+ self._state["station"]["lights"] = lights.serialize_lights()
def end_day(self, gamestate):
self._battery.apply_recharge()
+ gamestate.update_lights(self._lights)
from .night import NightScene
SceneChangeEvent.post(scene=NightScene())
if ev.type == pgl.KEYDOWN:
if not self._do_ticks:
# Any keypress exits
- self._to_day()
+ self._to_day(gamestate)
if ev.key in (pgl.K_q, pgl.K_ESCAPE):
from .menu import MenuScene
SceneChangeEvent.post(scene=MenuScene())
elif ev.type == pgl.MOUSEBUTTONDOWN:
if not self._do_ticks:
# Any mouse press exits
- self._to_day()
+ self._to_day(gamestate)
if ev.button == 1:
self._lights.toggle_nearest(ev.pos, surfpos=True)
from .menu import MenuScene
SceneChangeEvent.post(scene=MenuScene())
elif tool.name == 'day':
- self._to_day()
+ self._to_day(gamestate)
def toggle_pause(self):
self._paused = not self._paused
if tool.name == 'pause play':
tool.update_image("32", pause_img)
- def _to_day(self):
+ def _to_day(self, gamestate):
# End the night
+ gamestate.update_lights(self._lights)
from .day import DayScene
SceneChangeEvent.post(scene=DayScene())