- 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:
- self._seeds += seeds
- self._harvested += 1
- else:
- self._turnips.append(turnip)
+ def _draw_you_win(self, gamestate):
+ overlay = pygame.surface.Surface(
+ (SCREEN_SIZE[0], 240), pgl.SWSURFACE).convert_alpha()
+ overlay.fill((0, 0, 0, 128))
+ self._game_over_text.append((overlay, (0, 250)))
+ self._game_over_text.append(
+ (shadowed_text("You Win", FONTS["bold"], 48), (400, 280)))
+ self._game_over_text.append(
+ (shadowed_text(
+ ("You have Successfully Harvested %d turnips" %
+ gamestate.harvested),
+ FONTS["sans"], 24),
+ (300, 350)))
+ self._game_over_text.append(
+ (shadowed_text("Press a key to return to the menu",
+ FONTS["sans"], 24), (350, 400)))