- def left_click(self, surfpos):
- pos = pymunk.pygame_util.from_pygame(
- surfpos, pygame.display.get_surface())
- point_info = self._space.point_query_nearest(pos, 1.0, CLICK_FILTER)
- if point_info is not None:
- point_info.shape.body.light.toggle()
+ def left_click(self, pos):
+ light = self._lights.nearest(pos, surfpos=True)
+ if light:
+ light.toggle()