Line of Sight demonstration

https://ready.app.link/XRR9geBlU0

The grey ball can be dragged around.
The eye sprite is only visible when a clear path with no obstacles is possible to the grey ball.
The eye becomes invisible when obstacles are in the way between the eye and grey ball.
You can check the code to see how it’s done.

(This runs well on a tablet and glitches when played on a pc browser)

5 Likes

…Cool Logic!:+1:

4 Likes

Nice logic indeed. Clever idea for an upcoming game I think!

3 Likes