【求助】请问如何实现边移动边转弯的效果

小弟正在自学cocos,正在写一段游戏DEMO,希望实现如下功能:
1、点击屏幕某一个点,角色朝该点转向并同时移动。(移动轨迹是一条曲线)
2、当角色指向该点时则停止转向,并持续朝延伸方向移动。

效果如下图
提问动图

目前代码如下(COCOS版本:2.4.9;脚本语言:typescript):

const {ccclass, property} = cc._decorator;

@ccclass
export default class mapControl extends cc.Component {
@property(cc.Node)
player: cc.Node; // 玩家节点
playerAngle: number = null; // 玩家当前角度
flySpeed: number = null; // 飞行速度
turningSpeed: number = null; // 转角速度
xSpeed: number = null; // x轴速度
ySpeed: number = null; // y轴速度

start () {

    this.flySpeed = 100;
    this.turningSpeed = 2;
    this.node.on(cc.Node.EventType.TOUCH_START, this.onTouchTurning, this);

}

 触点移动方法
onTouchMove (degree: number) {
    const radian = degree * (Math.PI / 180);
    let x = 0;
    let y = 0;
    let resArr: number[] = null;
    x = Math.sin(radian);
    y = Math.cos(radian);
    resArr = [x,y];
    return resArr;
}


onTouchTurning (event) {

     // 获取触点位置
    let position = event.touch.getLocation();
    let worldPosition = this.node.convertToNodeSpaceAR(position);   //  触点坐标转换成世界坐标
    let targetPosition = new cc.Vec2(worldPosition.x, worldPosition.y);

    let angle = Math.atan2(targetPosition.x, targetPosition.y); // 计算角度
    this.playerAngle = angle * (180 / Math.PI);

    let turning = cc.rotateTo(this.turningSpeed , this.playerAngle);
    this.player.runAction(turning);

}

update (dt) {
    this.xSpeed = this.onTouchMove(this.playerAngle)[0];
    this.ySpeed = this.onTouchMove(this.playerAngle)[1];

    // 根据方向向量移动位置
    this.player.x += dt * this.xSpeed * this.flySpeed;
    this.player.y += dt * this.ySpeed * this.flySpeed;

    cc.Camera.main.node.x = this.player.x;
    cc.Camera.main.node.y = this.player.y;

}

}

现在的问题是,精灵只转向,没有实现在转向中移动。请教各位大佬如何改进,或者有别的思路还望不吝赐教。

以上,感谢!

贝塞尔曲线,了解一下相关知识

你可以找到你移动的下一个点的话,旋转面向下个点咯

曲线的切线的方向。

试过,但是曲线有一个线性的加速,不是匀速运动

这个计算角度的方法在update也要用上,加个变量lastPos, 存着物体上一帧的位置,然后根据上帧和这帧之间的差值,用这个计算角度的方法给物体设置角度,从头到尾也就加一个变量和每帧加些三角函数的数学计算,对性能没有影响,放心用

在初始角度、转角速度固定的情况下,如果目标离很近,有可能怎么转向都不能击中目标。
所以你要考虑好需求,如果允许这种情况发生才能像现在这么计算。

已解决。
update里持续获取精灵当前角度然后使用三角函数计算x,y即可。未使用额外变量。