Hello,
I'm working on a point'n'click engine, and I've having some issues with the walkable area (that's the area in the screen where the character can walk to). I define the walkable area using a polygon class where I add the vertices of the polygon (in green). Every time the player clicks on the screen, I check if the destination position (pixel) belongs to the walkable area. If it belongs, I calculate the shortest path to the destination (using Dijkstra algorithm). If not, I calculate the intersection point between the polygon and line from the …