pathfinding 3.0.1 copy "pathfinding: ^3.0.1" to clipboard
pathfinding: ^3.0.1 copied to clipboard

A Dart port of https://github.com/qiao/PathFinding.js library

example/example.dart

import 'package:pathfinding/finders/jps.dart';
import 'package:pathfinding/finders/astar.dart';
import 'package:pathfinding/core/grid.dart';

main() {
  var grid = new Grid(4, 4, [
    [0, 0, 1, 1], // 0 - walkable, 1 - not walkable
    [1, 0, 1, 1],
    [1, 0, 1, 1],
    [1, 0, 0, 0]
  ]);
  var path = new JumpPointFinder().findPath(0, 0, 3, 3, grid.clone());
  print(path); // [[0, 0], [1, 1], [1, 2], [2, 3], [3, 3]]

  path = new AStarFinder().findPath(0, 0, 3, 3, grid.clone());
  print(path); // [[0, 0], [1, 0], [1, 1], [1, 2], [1, 3], [2, 3], [3, 3]]
}
6
likes
120
pub points
61%
popularity

Publisher

unverified uploader

A Dart port of https://github.com/qiao/PathFinding.js library

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

More

Packages that depend on pathfinding