Code snippet for basic line of sight

82 views
Skip to first unread message

Jere Majava

unread,
Oct 22, 2017, 11:34:27 AM10/22/17
to PuzzleScript
I've been using line of sight in some of my PS games, but the solutions have been quite messy and have not even worked that well. Inspired by this discussion on pathfinding I decided to try to make a a better stand alone solution that could also be used in any Puzzle Script game and here it is:   


Just copy the code after LINE OF SIGHT to the end of your own code, add the two namespaced objects losV and losD to the top layer and list all your opaque objects in legend and you should be good to go. Oh, and run_rules_on_level_start is required.

Now I understand that line of sight might not be very useful in most puzzle games, but it might make your next maze or walking simulator more interesting / claustrophobic / frustrating.
Reply all
Reply to author
Forward
0 new messages