Hello there, let's do a little necro-topic-phily !
I just saw this post, doing some research on illuminated.js and its implementations around the web, and after starting to implement some basic functions of it (finding all the lightblocker segments, corners, some low level intersection functions, ...).
At first, I tried to implement it just by using the lib, but it seemed to block in lots of area, so I started rewriting it a little more.
I had some questions on how people think it would be best :
- for choosing the lightblockers, I went with a small behavior, a little like "solid", that you just add on the objects that should block the light. I then tried to reproduce the way that Pathfinder selects its blockers (custom or solids) but it isn't entirely working for custom yet. Do you see any other ways of selecting the good light blockers ? Should there be any other type of light blockers ?
- for displaying the light effect in the end (I haven't got into this point yet), I thought about asking for a base frame (just like the sprite), and cut it according to how the light polygon will be drawn. The alpha radius will then be prepared directly in the sprite, and a multiply should then be added to the "lightCaster" sprite. I'm still having hard time finding a good way to apply the frame correctly...
As this library is now up for some times, and surely somebody tried this before me, I would like to know if anybody had any advice or thoughts on how it would be best. Of course, if and when this is good, I'm planning on releasing it on the forums.