Skip to content
/ A-star Public

C++ implementation of the A* path-finding algorithm

License

Notifications You must be signed in to change notification settings

Rikora/A-star

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A* algorithm

Implementation of the A* path-finding algorithm with C++ (C++14).

Usage example

#include "AStar.hpp"
#include <iostream>

int main()
{
    pf::AStar astar;

    astar.loadMap("maps/map01.txt");
    astar.setDiagonalMovement(true);
    auto path = astar.findPath(pf::Vec2i(0, 0), pf::Vec2i(10, 7), pf::heuristic::euclidean, 10);

    for (const auto& coord : path) 
    {
        std::cout << coord.x << "," << coord.y << "\n";
    }

    system("pause");
    return 0;
}

Resources

License

This project is licensed under the MIT License, see LICENSE for more information.

About

C++ implementation of the A* path-finding algorithm

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages