Blocking light on a tiled level
<p>I'm making a tiled(tiles size is 16px) level scrolling game in Java.
Right now I'm dealing with the lighting system.
I calculated the light gradient(as shown on the picture) with this code for each light(yellow blocks and tiles):</p>

<pre><code>visMap = new int[level.getWidth() * level.getHeight()];

    int lighted = 0;

    for (int x = 0; x &lt; level.getWidth(); x++) {
        for (int y = 0; y &lt; level.getHeight(); y++) {
            double xd = (this.x &gt;&gt; 4) - x;
            double yd = (this.y &gt;&gt; 4) - y;

            double distance = Math.sqrt(xd * xd + yd * yd);

            double p = power * 1.0;
            double bright = p - distance;

            visMap[x + y * level.getWidth()] = (int) (bright * power);
        }
    }
</code></pre>

<p>And now I'm trying to make the block somehow block the light(like in real life).
Is there a good method for this?
Thank's in advance,
Zaplik</p>

<p>The Picture: <a href="http://i.imgur.com/f0n5x.png" rel="nofollow">click</a></p>
