How do I find the quickest path from point A to point B

0 favourites
  • 2 posts
From the Asset Store
Connect the dots in the correct order and draw happy animals!
  • So I'm building a tilemap that is randomly generated. It generates walls and collisions. I have everything working fine. I start in the upper left corner. My exit is in the bottom right corner, but throughout, there are walls and such since this works like a maze. You have to find an object (gem or whatever) and then find the exit before your clicks run out.

    I have all of this working, but I'm unsure on how to find the quickest path from the starting point object to the gem object. Then from the gem object to the exit. Of course, I would give a little leeway. I'm using Pathfinder, but it seems to be not finding the quickest path AND sometimes it doesn't even find a path which is highly unlikely since I go through it and there clearly is a path. There is always a path the way I'm generating it.

    Does anybody have any ideas on how to go about this? Thanks!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Since you are using a tilemap, you might be interested in this plugin I made.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)