Skip to content

sarkahn/sark_pathfinding_rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

License: MIT Crates.io docs

A simple implementation of the astar pathfinding algorithm from red blob games.

In order to use the pathfinder you must have a path map for it to navigate. You can define one by implementing the PathingMap trait, or you can use the built-in PathMap2d.

Example

use sark_pathfinding::*;

let mut map = PathMap2d::new([50,50]);
let mut pf = Pathfinder::new();

// Set position [5,4] of the path map to be a pathfinding obstacle.
map[5,4] = true;

let path = pf.astar(&map, [4,4], [10,10]).unwrap();

From the "terminal" example.

Releases

No releases published

Packages

 
 
 

Languages