scirra.com/forum/how-to-prevent-closing-the-path-of-the-pathfinder_topic74474_post445894.html
My Question
I'm making a tower defense game where you can put the towers whereever you want and the enemies find their path to the base using the pathfinder , the only issue that you can close the path with the towers and the enemies stop moving , does anyone encountered this problem before ? please give me a solution or a way to make it work , thank
You Suggested
The other option is to prevent the player from putting down a blocking tower at all. In this case, just before you actually place down the tower (once it's been verified for position, cost, etc.), run a pathfinding action to see if a path is possible once the tower would be theoretically placed down. If it's not possible, prevent the tower from being placed.
My Reply
That doesn't seem to work because you now get two pathfinders working at the same time. and Because you need to refresh the obstacle map before you find the path , now the obstacle map updates obstacles for the first pathfinder and the second pathfinder updates other obstacles and it ends up not working at all