import pymunk.pygame_util
from .base import BaseScene
-from ..lights import LightManager
+from ..lights import LightManager, light_fitting_by_type
from ..obstacles import ObstacleManager
from ..events import SceneChangeEvent
- from ..utils import debug_timer
+ from ..utils import debug_timer, shadowed_text
from ..loader import loader
-from ..transforms import Overlay, Multiply, Alpha
+from ..transforms import Overlay, Alpha, ColourWedges
-from ..constants import SCREEN_SIZE, FONTS, COLOURS
+from ..constants import SCREEN_SIZE, FONTS
from ..widgets import ImageButton
from ..turnip import Turnip, TurnipInvalidPosition
for light_tool in self._light_toolbar:
light_tool.render(surface)
self._draw_cursor(surface)
+ if self._game_over_text:
+ for surf, pos in self._game_over_text:
+ surface.blit(surf, pos)
def _draw_light_toolbar(self, light_config, x):
- self._light_toolbar = []
height = SCREEN_SIZE[1] - 80
- for color in sorted(COLOURS.keys()):
- light_tool = ImageButton('32', light_config["type"] + '.png',
- pos=(x, height), name=color,
- transform=Multiply(colour=COLOURS[color]))
+ self._light_toolbar = []
+ colour_combos = light_config["available_colours"]
+ for combo in colour_combos:
+ colours = combo.split("/")
+ light_fitting = light_fitting_by_type(light_config["type"])
+ light_tool = ImageButton(
+ "32", light_fitting, transform=ColourWedges(colours=colours),
+ pos=(x, height), name=combo)
+ light_tool.colours = colours
self._light_toolbar.append(light_tool)
x += 40