Rescale intensity.
authorSimon Cross <hodgestar@gmail.com>
Sat, 10 Sep 2016 11:04:17 +0000 (13:04 +0200)
committerSimon Cross <hodgestar@gmail.com>
Sat, 10 Sep 2016 11:04:17 +0000 (13:04 +0200)
tabakrolletjie/lights.py

index 1eaba7c8e92ee3804026383fdc3ece6c06dfe203..fef2b44d2133e32c2f43d2e1366ad00101e8559e 100644 (file)
@@ -214,8 +214,8 @@ class BaseLight(object):
 
             if ncolour == 1:
                 self._fitting_image = loader.load_image(
-                "48", self.FITTING_IMG,
-                transform=Multiply(colour=fitting_colours[0]))
+                    "48", self.FITTING_IMG,
+                    transform=Multiply(colour=fitting_colours[0]))
             else:
                 if self._colour_mult_image is None:
                     self._colour_mult_image = pygame.surface.Surface((48, 48))
@@ -224,8 +224,8 @@ class BaseLight(object):
                         sector = loader.load_image(
                             "48", "light_mask_%d_%d.png" % (ncolour, i + 1),
                             transform=Multiply(colour=fitting_colours[i]))
-                        self._colour_mult_image.blit(sector, (0,0), None, 0)
-                    
+                        self._colour_mult_image.blit(sector, (0, 0), None, 0)
+
                 self._fitting_image = loader.load_image(
                     "48", self.FITTING_IMG,
                     transform=MultiplyImage(image=self._colour_mult_image))
@@ -244,7 +244,7 @@ class BaseLight(object):
             return 0.0
         area = math.pi * (self.ray_manager.max_radius ** 2)  # radius
         area = area * (self.ray_manager.spread / (2 * math.pi))  # spread
-        return 5 * area * self.intensity
+        return 5 * area * self.intensity / 6400  # 80x80 unit area
 
     def base_damage(self):
         return 5 * self.intensity