Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How would I go about finding the fastest path to connect two points on a grid? I'm making a 2D game and the map is based around a grid.

I need to be able to account for any blocked tiles that the path need be able to go through.

The blue line being what I need to figure out, and the red tiles being the blocked tiles.

Where should I start? Any advice be would great!

share|improve this question
up vote 8 down vote accepted

Sounds like you want A-star path-finding, which is pretty much the defacto for path-finding. I used this in my XNA game: (I repackaged the library into a slightly more usable stand-alone DLL).

share|improve this answer
This looks exactly like what i need. Thanks for the quick reply. :) – Milkboat Mar 6 '12 at 2:51

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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