pygame.draw.polygon(ray_mask, white, pygame_poly, 1)
dt.lap("ray mask rendered")
+ light_colour = self.COLOURS[self.colour]
+ intensity = int(255 * self.intensity)
+ light_colour = light_colour + (intensity,)
+
radius_mask.fill(black)
centre = pymunk.pygame_util.to_pygame(self.position, surface)
pygame.draw.circle(
- radius_mask, white, centre, int(max_radius), 0)
+ radius_mask, light_colour, centre, int(max_radius), 0)
pygame.draw.circle(
radius_mask, black, centre, int(min_radius), 0)
dt.lap("radius mask rendered")
ray_mask.blit(radius_mask, dest_rect, dest_rect, pgl.BLEND_RGBA_MULT)
dt.lap("blitted radius mask to ray mask")
- light_colour = self.COLOURS[self.colour]
- intensity = int(255 * self.intensity)
- light_colour = light_colour + (intensity,)
-
- ray_mask.fill(light_colour, dest_rect, pgl.BLEND_RGBA_MULT)
- dt.lap("coloured ray mask")
-
surface.blit(ray_mask, dest_rect, dest_rect)
dt.lap("blitted surface")
dt.end()