Closed ndouglas closed 5 years ago
I did a quick-and-dirty demo (extremely inefficient [looping through every tile in a 20-tile radius] and incomplete -- no FOV, no mobile light sources) just to see what it'd look like if I did a naïve approach and just transformed tiles with each light source:
Another screenshot with more random output:
I think that looks pretty good. I definitely need to create some efficient data structures for handling this, though, because every tile looped through every tile in a 10-tile radius to render itself, which is insane. Also, you can definitely see hard edges on here from the 10-tile radius cutoff with lights with higher radii.
This is of course a far more eccentric set of conditions than I expect would ever actually exist in this game. I do have thoughts about e.g. phosphorescent mosses and light from spells, etc.
Some rough edges, but I think this is good enough to move forward with.
Currently, the only light source I render is the player's, and I do it by calling a function on the tile.
Instead, I should call e.g. render() on the tile, passing the game, and the tile should render itself based on its local conditions, grabbing all light in the area, etc.