self._tool = None
self._light_colors = None
self._dragging = None
- # Turnip
- self.grow_turnips(gamestate)
+ # Create Turnips
+ for turnip_data in gamestate.turnips:
+ turnip = Turnip(space=self._space, **turnip_data)
+ self._turnips.append(turnip)
# Tools
self._light_toolbar = []
self._tools = self.create_tools(gamestate)
(shadowed_text("Press a key to return to the menu",
FONTS["sans"], 24), (350, 400)))
- def grow_turnips(self, gamestate):
- for turnip_data in gamestate.turnips:
- turnip = Turnip(space=self._space, **turnip_data)
- # Turnips grow at dawn
- seeds = turnip.grow()
- if seeds:
- gamestate.seeds += seeds
- gamestate.harvested += 1
- else:
- self._turnips.append(turnip)
-
def create_tools(self, gamestate):
tools = []
def exit(self, gamestate):
self._unset_cursor()
- turnip_data = [turnip.serialize() for turnip in self._turnips]
- gamestate.turnips = turnip_data
def end_day(self, gamestate):
if self._ending:
return
self._battery.apply_recharge()
gamestate.update_lights(self._lights)
+ turnip_data = [turnip.serialize() for turnip in self._turnips]
+ gamestate.turnips = turnip_data
self._ending = True
from .night import NightScene
SceneChangeEvent.post(scene=NightScene())