Skip to main content

Find a Way

A pathfinding demo demonstrating A*

Sean J McKiernan

This is a simple pathfinding demo that I made investigating A*.



  • Mouse left button: add start/goal, draw barriers
  • Mouse right button: delete start/goal/barriers

(clicking the text on the screen triggers and toggles functions if you don't want to memorize hotkeys)


  • Space: Start
  • Enter: Restart
  • i: Reset to initial state
  • 1,2,3: Switch between Rook, Queen, and Knight movement
  • d: Toggle animation on/off
  • Esc: Quit



Home Page


Find a Way 0.01 — 3 Dec, 2011

Find a Way Recode — 24 Jun, 2013 account Comments

  • Ppaterson 2011-12-03 17:49:04

    Very cool.

    You might also want to check out networkx. I have been using this in a couple of my games and it is very fast and flexible. You make a graph of your 'board' and then use the shortest path functions to find a path, either weighted or not.

    I can share some code if you are interested.


    Mekire 2011-12-04 07:21:04

    Thank you.  As for networkx it sounds interesting but I am somewhat hesitant to include dependencies that would require additional installation by users unless absolutely necessary.


  • Gamer90030 2013-07-05 20:04:17


    Mekire 2013-07-08 00:20:41

    Seriously? It would take you two seconds googling to find a program that can unzip for you, if indeed you really can't do it.

    If you REALLY can't unzip a zip under any circumstance then copy the code from the repository. >.>


    Gamer90030 2013-07-08 02:18:40

    Pretty much all programs I Google are viruses. It's hard to find the right thing out there.

  • MentalAtrophy 2014-02-11 06:49:12

    Hey, mate, is it cool if I incorporate your solver module into one of my projects and modify the heuristics? I've done some testing with it already and it works really well for real-time pathfinding of multiple entities if I throttle the number of Star.evaluate() calls based on the total number of entities that are actively updating their pathfinding.

    Edit: Nevermind, I made my own anyway. I borrowed your idea of separating the search into its own evaluate() method though, because I liked that instead of burying the whole thing in a while loop.

    Mekire 2014-02-22 14:49:43

    Seems like you solved your problem already, but yes, feel free to use it for anything you desire. I'm sure it can still be more efficient.

  • Real name 2017-08-30 13:35:23.353640

    IDK how to build A* pathfinder (I got 3 versions, and three of them don't works)
  • ridgen 2018-02-15 16:39:52.221017

  • Fabian 2020-10-16 14:38:58.532768

    very nice!