Fast 2D pathfinding algorithm based on Points and Neighbours.
Example program require MonoGame, but the algorithm(in folder CPF) is writting in pure C#. This scripts can work on others game engine, such as Unity.
- Add .cs files from CPF folder to your project.
- Instantiate Map
Map map = new Map();
- Add points and neighbour relations
map.AddPoint(x,y); //Create Point called "P_x_y" map.AddNeighbour(name1, name2); //Create neighbour relation between name1 and name2 point //Find script can only move from point to his neighbour
- Find path
map.Find(startPoint, endPoint); //Return List<string> contains list of path points
functions throw an exception when point hasn't joined to rest of the map