from ..loader import loader
from ..transforms import Overlay
from ..turnip import Turnip
+from ..constants import NIGHT_LENGTH
class NightScene(BaseScene):
self._turnips.append(turnip)
self._soil = loader.load_image(
"textures", "soil.png", transform=self.DARKNESS)
+ self._total_ticks = 0
@debug_timer("night.render")
def render(self, surface, gamestate):
@debug_timer("night.tick")
def tick(self, gamestate):
- self._mould.tick(gamestate, self._space, self._lights)
- self._lights.tick()
- print "Power usage: ", self._lights.total_power_usage()
+ if self._total_ticks < NIGHT_LENGTH:
+ self._mould.tick(gamestate, self._space, self._lights)
+ self._lights.tick()
+ print "Power usage: ", self._lights.total_power_usage()
+ self._total_ticks += 1
def exit(self, gamestate):
turnip_data = [turnip.serialize() for turnip in self._turnips]