import pymunk
from .base import BaseScene
+from ..battery import BatteryManager
from ..lights import LightManager
+from ..infobar import InfoBar
from ..obstacles import ObstacleManager
from ..enemies import Boyd
from ..events import SceneChangeEvent
self._space = pymunk.Space()
self._obstacles = ObstacleManager(self._space, gamestate)
self._lights = LightManager(self._space, gamestate)
+ self._battery = BatteryManager(gamestate)
+ self._infobar = InfoBar("day", battery=self._battery, scene=self)
self._mould = Boyd(gamestate, self._space)
self._turnips = []
for turnip_data in gamestate.turnips:
tools = []
y = SCREEN_SIZE[1] - 40
tools.append(ImageButton(
- '32', 'pause.png', name='pause play', pos=(SCREEN_SIZE[0] - 150, y)))
+ '32', 'pause.png', name='pause play',
+ pos=(SCREEN_SIZE[0] - 150, y)))
tools.append(ImageButton(
'32', 'exit.png', name='exit', pos=(SCREEN_SIZE[0] - 50, y)))
return tools
+ @property
+ def turnip_count(self):
+ return len(self._turnips)
+
+ @property
+ def power_usage(self):
+ return int(self._lights.total_power_usage())
+
@debug_timer("night.render")
def render(self, surface, gamestate):
surface.blit(self._soil, (0, 0))
self._lights.render_light(surface)
self._obstacles.render(surface)
self._lights.render_fittings(surface)
+ self._infobar.render(surface, gamestate)
for tool in self._tools:
tool.render(surface)