Lights Off, Spot On!
I’ve just finished a plain lighting system for my sidescroller. It is possible to place custom sprites as lights into the scene. Those sprites are used to render a lightmap which represents the result of all lightsources in the current scene.
Now I can create scary places for the player
Posted on October 13, 2009 at 11.09 pm by Paul · Permalink
In: games, programming · Tagged with: Failsafe, flash, FlashDevelop, flixel, light, Vessel
In: games, programming · Tagged with: Failsafe, flash, FlashDevelop, flixel, light, Vessel

on 2009-10-29 at 8.00 pm
Permalink
sieht cool aus!
on 2010-04-30 at 11.59 pm
Permalink
Cool! I’ve been trying to do something like this myself, I don’t suppose you could share how you did the lighting?
on 2010-05-03 at 4.23 pm
Permalink
Hi Steve.
In fact, it wasn’t a big deal. I’m just drawing lightmaps (sprites in the color and shape of the light) on a black global lightmap (with the size of the screen) using the blend mode “BlendMode.SCREEN”.
That way I get a global merged lightmap with all lights in it. Then I’m just rendering this global light over the whole scene using the blend mode “BlendMode.MULTIPLY”.
That’s all
If you’re using flixel too, you just have to override the render methods in your lighting classes.
Maybe some day I’ll write a short tutorial about it.