PathBuilder

Used for generating Paths in a space, from one position to another. The Path will be generated as soon as the PathBuilder is constructed.

Constructor

new PathBuilder(space, start, end, smooth)

Create a new PathBuilder.
Parameters:
NameTypeDefaultDescription
spaceSpaceSpace to generate the Path in
startVec2Starting position of the Path
endVec2Ending position of the Path
smoothbooleantrueWhether to smooth/simplify the path by removing unnecessary points. This makes for much more realistic (and efficient to use) paths (Optional)

Methods

get() → {Path|null}

Get the resulting Path.
Returns:
The resulting path, or null if unsuccessful.
Type: 
Path | null