Code:
//fade light
temp_distance = vec_dist (my.x, player.x);
r = my.skill2 - ((temp_distance - fade_start) / fade_end) * my.skill2;
g = my.skill3 - ((temp_distance - fade_start) / fade_end) * my.skill3;
b = my.skill4 - ((temp_distance - fade_start) / fade_end) * my.skill4;
if(my.skill2 < 1)
{
my.lightrange = 0;
}else
{
my.lightrange = my.skill1;
}
Maybe a stupid question, but how does the light fade?
I don't think that the value of my.skill2 is changing.
I have tried this in a verry long corridor with several lights, but the only ones that are lit are the ones at the end of the corridor. Other lights does not go on or off when walking through the corridor.