sark_pathfinding

Crates.iosark_pathfinding
lib.rssark_pathfinding
version0.2.0
sourcesrc
created_at2022-01-16 09:55:25.772285
updated_at2022-11-13 18:41:11.498701
descriptionA simple implementation of the astar pathfinding algorthim from red blob games https://www.redblobgames.com/pathfinding/a-star/implementation.html.
homepagehttps://github.com/sarkahn/sark_pathfinding_rs
repositoryhttps://github.com/sarkahn/sark_pathfinding_rs
max_upload_size
id514712
size196,429
sark (sarkahn)

documentation

README

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 map = PathMap2d::new([50,50]);
let mut astar = AStar::from_size([50,50]);

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

From the "terminal" example.

Commit count: 13

cargo fmt