Merge branch 'master' of ctpug.org.za:tabakrolletjie
authorSimon Cross <hodgestar@gmail.com>
Fri, 9 Sep 2016 21:48:34 +0000 (23:48 +0200)
committerSimon Cross <hodgestar@gmail.com>
Fri, 9 Sep 2016 21:48:34 +0000 (23:48 +0200)
1  2 
tabakrolletjie/lights.py

diff --combined tabakrolletjie/lights.py
index 34160f006de713ce58163cf54307f0995047cc12,f34d32d889c926a37fd0e1ab29e819a2cc016a5c..12b3fe07a07898483930c8fb90f08ea2c5ba47ec
@@@ -65,10 -65,7 +65,10 @@@ class LightManager(object)
          point_info_list = self._space.point_query(
              pos, max_distance, pymunk.ShapeFilter(mask=LIGHT_CATEGORY))
          lights = [p.shape.body.light for p in point_info_list]
 -        return [light for light in lights if light.on]
 +        return [
 +            light for light in lights
 +            if light.on and light.ray_manager.reaches(pos)
 +        ]
  
      def light_query(self, shape):
          """Query the lights by shape"""
          shape_info_list = self._space.shape_query(shape)
          shape.filter = old_filter
          lights = [p.shape.body.light for p in shape_info_list]
 -        return [light for light in lights if light.on]
 +        return [
 +            light for light in lights
 +            if light.on and light.ray_manager.reaches(shape.body.position)
 +        ]
  
      def render_light(self, surface):
          for light in self._lights:
@@@ -102,7 -96,8 +102,8 @@@ class BaseLight(object)
      COLOURS = {
          "red": (255, 0, 0),
          "green": (0, 255, 0),
-         "blue": (0, 255, 255),
+         "blue": (0, 0, 255),
+         "cyan": (0, 255, 255),
          "yellow": (255, 255, 0),
          "white": (255, 255, 255),
      }