
23 August, 2021
I've almost perfected the code for FoW / Line-of-Sight...
Here in the screen shot you can see several objects blocking and shadows cast
behind them away from the mouse.
The challenge had been how to know how to create the shadow without blocking the
object that's causing it. All objects closest to the mouse block the view of any
other objects.
There are some minor glitches with the Ray-casting, and only in certain
situations. I think it stems from the math involved with the Trigonometry -
possibly a division by zero?
This "simple" screen here is much larger than what the main project has. In this
simple version, if too many objects are placed, the system gets bogged down. In
the main project will have a limited amount of items on the screen that would
create shadows.
And the current glitches I mentioned can probably be masked with a circular
template that will be used to cause a "fading" around the edge of the diameter.
I think for now I will put this aside to continue on with the main project.
Another screen shot without the rays being projected on screen...
