Skip to content

emanuel2718/AstarPathfinding

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A* Pathfinding Visualizer

insert some project description here

Installation

Clone this repo

git clone https://github.com/emanuel2718/AstarPathfinding
cd AstarPathfinding

Install requirements

pip install -r requirements.txt

Preview

Premade

   

Custom

How to use

Run the visualizer:

python main.py

Command line argument options:

Diagonal movement during the A* star algorithm

python main.py -d

 

Keybindings:

  • s : Add starting node (hover over desired square and press the key)

  • e : Add ending node (hover over desired square and press the key)

  • i : Invert grid background color (White -> Black or Blac -> White)

  • c : Toogle on/off the coordinate system renderer on the grid

  • ? : Toogle on/off keybinds help panel

  • n : Toogle on/off the score system renderer on the grid

    • Bottom left    : G score --> movement cost from current square to start square
    • Bottom right  : H score --> movement cost from current square to end square
    • Top left          : F score --> total score (h + g = f)  
  • Esc : Toogle on/off the settings panel

  • L_Shift+R : Restart the game

  • Left click or drag: Add walls (obstacles)

  • Right click or drag: Remove walls

TODO:

  • Add close game keybind (i.e press 'q' to quit)
  • Make it possible to de-select an initial node with right click (like the walls)
  • Show notification with a tkinter window
  • Make the UI look more polished (i.e Settings panel, keybinds panel etc.)
  • Make a better settings panel (interactive with buttons)
  • Refactor majority of the code (Mouse and key handlers etc.)
  • Show time it took to find the path
  • Optimize scores and coordinates renderer to handle different window sizes

About

A* Pathfinding algorithm visualizer written in Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages