+ def toggle_pause(self):
+ self._paused = not self._paused
+ pause_img = "play.png" if self._paused else "pause.png"
+ for tool in self._tools:
+ if tool.name == 'pause play':
+ tool.update_image("32", pause_img)
+
+ def _to_day(self):
+ # End the night
+ from .day import DayScene
+ SceneChangeEvent.post(scene=DayScene())
+
+ def _end_night(self):
+ self._do_ticks = False
+ self._night_over_text = []
+ overlay = pygame.surface.Surface(
+ (SCREEN_SIZE[0], 240), pgl.SWSURFACE).convert_alpha()
+ overlay.fill((0, 0, 0, 172))
+ self._night_over_text.append((overlay, (0, 40)))
+ self._night_over_text.append(
+ (shadowed_text("The Night is Over", FONTS["bold"], 48), (300, 50)))
+ self._night_over_text.append(
+ (shadowed_text("Turnips eaten tonight: %d" % self._eaten_tonight,
+ FONTS["sans"], 32), (300, 130)))
+ self._night_over_text.append(
+ (shadowed_text("Surviving turnips: %d" % len(self._turnips),
+ FONTS["sans"], 32), (300, 170)))
+ self._night_over_text.append(
+ (shadowed_text("Press any key to continue", FONTS["sans"], 24),
+ (350, 240)))
+
+ @debug_timer("night.tick")