There are several elements in FlxObject that have x and y properties, such as velocity, acceleration, drag and maxVelocity to name a few. They are all instances of FlxPoint, which totally makes sense.
The position of a FlxObject, however, is represented by two different Number properties. If they were represented by FlxPoint like everything else, checking the distance between two objetcs or sprites would be as easy as a.position.distance(b.position).
I suggest adding a position:FlxPoint property to FlxObject, turning the current x and y properties into getters/setters.
There are several elements in
FlxObjectthat havexandyproperties, such asvelocity,acceleration,dragandmaxVelocityto name a few. They are all instances ofFlxPoint, which totally makes sense.The position of a
FlxObject, however, is represented by two differentNumberproperties. If they were represented byFlxPointlike everything else, checking the distance between two objetcs or sprites would be as easy asa.position.distance(b.position).I suggest adding a
position:FlxPointproperty toFlxObject, turning the currentxandyproperties into getters/setters.