Hi,
reading OpelFL documents I've found an implementation of Bezier using path.
This feature permit to move an object from point A to point C pass through point B using a smooth curve.
I've trying an implementation in Actor using tween features and tested it without collision and seems has no issue.
It's pretty and can be implemented in a future Stencyl version.
My implementation:
public function bezierTo(x:Float, y:Float, checkPointX:Float,checkPointY:Float,strength:Float,duration:Float = 1, easing:Dynamic = null) {
tweenLoc.x = getX(false);
tweenLoc.y = getY(false);
if(easing == null)
{
easing = Linear.easeNone;
}
activePositionTweens++;
var path = new MotionPath().bezier(x, y, checkPointX, checkPointY ,strength);
Actuate.motionPath(tweenLoc, duration, { x:path.x, y:path.y }, false ).ease(easing).onComplete(onTweenPositionComplete);
}
Actuate.motionPath use tween inside. This make me confidend about Actor features used in this implementation, like in Actor.moveTo method.
Let me know if you import this feature in Stencyl, so I didn't modify Actor class code to any Stencyl update.
Thanks, David.