FlxPath does too much, in a way that makes it hard to do anything else. FlxBasePath allows to you create your own follow logic. This is mainly because FlxPath has a lot of features that I feel I need to work around, and other features that, frankly, don't make any sense to me, like axes.
FlxBasePath is also a complete overhaul of FlxPath and will eventually fecilitate it's replacement in a (much) later version. Here's is a list of those changes:
Paths extend FlxBasic and behave in line with most other flixel objects. This means you can add a path to a group to control an object, too.
onComplete = func; is deprecated for onEndReached.add(func);, also added onFinished and onNodeReached
Base paths do not make a copy of nodes passed into the constructor, if you want a copy, make a copy
Base Paths do not have FlxPath's start function or setProperties function. To stop or disable a path set it's active to false. If a nodes and target is supplied in the constructor, it will begin, if not it is considered finished and you'll need to supply nodes, a target and call restart() or startAt(i)
You should see NO DIFFERENCE in the behavior of FlxPaths, if you do, let me know
Note: FlxObject.path is still a FlxPath, if you want to use custom path logic you'll need to manage it yourself
Long Term
I'd like to deprecate FlxPath or rename it to FlxPathLegacy and then make a new simplified version that doesn't have: axes, immovable and all the specific functions currently replaced by new FlxBasePath ones
FlxPath does too much, in a way that makes it hard to do anything else. FlxBasePath allows to you create your own follow logic. This is mainly because
FlxPath
has a lot of features that I feel I need to work around, and other features that, frankly, don't make any sense to me, likeaxes
.FlxBasePath
is also a complete overhaul ofFlxPath
and will eventually fecilitate it's replacement in a (much) later version. Here's is a list of those changes:FlxBasic
and behave in line with most other flixel objects. This means you can add a path to a group to control an object, too.onComplete = func;
is deprecated foronEndReached.add(func);
, also addedonFinished
andonNodeReached
nodes
passed into the constructor, if you want a copy, make a copystart
function orsetProperties
function. To stop or disable a path set it'sactive
tofalse
. If anodes
andtarget
is supplied in the constructor, it will begin, if not it is consideredfinished
and you'll need to supply nodes, a target and callrestart()
orstartAt(i)
Note: FlxObject.path is still a FlxPath, if you want to use custom path logic you'll need to manage it yourself
Long Term
I'd like to deprecate
FlxPath
or rename it toFlxPathLegacy
and then make a new simplified version that doesn't have:axes
,immovable
and all the specific functions currently replaced by new FlxBasePath onesTo Do
Thoroughly check that FlxPath still works, lol
Check Pathfinding demoCheck debug draw