I only found the formula for check the collision between two lines. But never about of movement and fixed from one point to other point in one of the line.

I need move from pA to pB and if take collision in one line (wall), move around before of the wall to the new destiny point fixed.

Where found this and/or which is the formula?


What you are looking for is a Pathfinding algorithm. You should take a look at the A-star algorithm wich is wiedely used in the video game industry. It computes the fastest way from point A to point B based on the reachable nodes of your game.

Here are some interesting links about the subject :

  • \$\begingroup\$ No is a Pathfinding algorithm, why i need change the destiny of the point B. By any blocked wall or obstacle you need reduce the distance or cut if not have way. And you not need change the direction, is always direct to point B. \$\endgroup\$ – RmBeer Jun 28 '17 at 18:58
  • \$\begingroup\$ I'm sorry I didn't understand what you said. You could try to re-explain ? \$\endgroup\$ – Shashimee Jun 29 '17 at 7:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.