Esempio n. 1
0
 private void ApplyLightToSegment(Block block, int i, int j, float blockBrightness, Color lightColour)
 {
     //Lerp is used to limit the amount of colour that this light introduces based on the brightness of this light
     block.SetLightColour(i, j , Color.Lerp(lightColour, Colour, blockBrightness));
     if (block.GetBrightness(i, j) > 0)
     {
         block.SetBrightness(i, j,
             Math.Max(blockBrightness, block.GetBrightness(i, j)) +
             Math.Min(blockBrightness, block.GetBrightness(i, j)) / 3);
     }
     else
         block.SetBrightness(i, j, blockBrightness);
 }