const grid = createNavGrid({ width: 32, height: 32, cellSize: 16 });
const ecs = ECSpresso.create()
.withPlugin(createTransformPlugin())
.withPlugin(createSteeringPlugin())
.withPlugin(createPathfindingPlugin({ grid }))
.build();
ecs.spawn({
...createTransform(0, 0),
...createMoveSpeed(100),
...createPathRequest({ x: 500, y: 300 }),
});
Create a pathfinding plugin for ECSpresso.
Requires the transform and steering plugins to be installed (entities need
worldTransformfor start-cell detection andmoveTarget/moveSpeedfor waypoint traversal).