Skip to content

Whittler23/A-star-algorithm-SFML

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A* SFML Algorithm

Simple grid-based pathfinding! Algorithm is implemented using C++17 but graphics is made with help of SFML in 2.5.1 version. A* is useful when we need to get a path of an entity to the goal point. Such a situation usually happens in games.

Grid screen

Demonstration video

Program demonstration

Tile colors

Every type of tile is represented by specified color:

  • #00b159 ---> Starting node
  • #d11141 ---> Targeted node
  • #00aedb ---> Path node
  • #000000 ---> Obstacle node
  • #ffffff ---> Default node

Usage example

By clicking on the grid with LPM, the user can set targeted ( #d11141 ) and starting node ( #00b159 ) alternately. If both are set, the user can press "SOLVE" button. After that, the program computes the path which can be seen as cyan tiles ( #00aedb ). In the top left corner, there's an informational window which displays time which was required to perform the calculation.

By pressing the grid with PPM, the user sets the obstacles ( #000000 ) for the path.

User can reset obstacles by pressing "RESET OBSTACLES" button.

And reset the path by pressing "RESET" button.

In the bottom right corner there's a switch button which can change between "DIAG ON" and "DIAG OFF" which means diagonal search on the grid.

Links I used

AStar Algorithm Explanation Part 1
AStar Wikipedia page
A Star (A*) Path Finding C++

About

Project in which the A Star algorithm is implemented in C++ with the help of SFML in graphics.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages