alpathfinder
v0.3.1
Published
A Rust/WASM Pathfinder for Adventure.Land.
Readme
ALPathfinder
A Rust/WASM Pathfinder for Adventure.Land.
Usage
- Run
npm i alpathfinderto install. - Import the pathfinder
import * as ALPathfinder from "alpathfinder";- Prepare the pathfinder with values from
Gand an optional list of maps you wish to ignore.
const ignoreMaps = [
"abtesting",
"bank_b", // NOTE: Don't ignore if you have access
"bank_u", // NOTE: Don't ignore if you have access
"cgallery",
"d2",
"d_e",
"duelland",
"shellsisland",
"ship0",
"test",
"old_bank",
"old_main",
"original_main",
"resort",
"resort_e",
];
ALPathfinder.prepare(parent.G, ignoreMaps);- Use the pathfinder
ALPathfinder.canWalkPath(character.map, character.x, character.y, 123, 456)
const path = ALPathfinder.getPath(character.map, character.x, character.y, "spookytown", 0, 0, character.speed);
pathfinder.isWalkable("main", 200, 20)Development
Build
- Run
wasm-pack buildto build. - Add
typed-adventurelandas a dependency
Test
- After building, install the package by referencing the
pkgdirectory that was builtnpm i ../path/to/alpathfinder/pkg.
