add FlxBasePath, extends base in FlxPath #3153
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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