ondras / rot.js

ROguelike Toolkit in JavaScript. Cool dungeon-related stuff, interactive manual, documentation, tests!
https://ondras.github.io/rot.js/hp/
BSD 3-Clause "New" or "Revised" License
2.33k stars 254 forks source link

Individual Light Strengths (feature request) #158

Open hyakugei opened 5 years ago

hyakugei commented 5 years ago

Right now all lights "throw" to the range value passed into the ROT.Lighting() object. Is it possible for each individual light have its own range?

hyakugei commented 5 years ago

I guess for each set of light strengths i can run/use a new instance of the ROT.Lighting() with that range, and then using the example in the lighting section, combine all those values together... Not sure if the mixing will look as good - going to try it though.

ondras commented 5 years ago

Hi @hyakugei ,

your idea makes sense, but only for a 1-pass run of ROT.Lighting. Please note that there is also the possibility to compute the light intensity recursively in multiple passes, where every single cell that was lit in the first pass becomes a (small) light source for the second pass.

So while it is straightforward to make explicit lights have their own range, I have no clue what shall be the range for these secondary (tertiary, ...) light sources.

I am, however, pretty convinced that most people are using ROT.Lighting for a 1-pass only, where the suggested improvement makes complete sense.