I am aware this question has been asked before, but unfortunately I am new to the language, so the complicated explanations I've found do not help me in the least.
I need a lighting engine for my game, and I've tried some procedural lighting systems. This method works the best:
if (light[xx - 1, yy] > light[xx, yy]) light[xx, yy] = light[xx - 1, yy] - lightPass;
if (light[xx, yy - 1] > light[xx, yy]) light[xx, yy] = light[xx, yy - 1] - lightPass;
if (light[xx + 1, yy] > light[xx, yy]) light[xx, yy] = light[xx + 1, yy] - lightPass;
if (light[xx, yy + 1] > light[xx, yy]) light[xx, yy] = light[xx, yy + 1] - lightPass;
(Subtracts adjacent values by 'lightPass' variable if they are more bright) (It's in a for() loop)
This is all fine and dandy except for:
The system favors whatever comes first in the for() loop
This is what the above code looks like applied to my game:
On the left side you can see some weirdness going on:
The loop goes top to down then to the right column:
This is how the for() loop goes:
Light provided from my mouse, should be a full light, but is only half:
If I could get some help on creating a new procedural or otherwise lighting system I would really appreciate it!