0

我正在 XNA C# 中制作一条腿移动的简单动画。这是大腿的逻辑代码。它的目的是从 25' 到 335' 摆动。然而,相反,它击中一个点,然后继续向另一个方向旋转。请帮忙,这是代码:

    private void Thigh_method()
    {
        if (Legdata.Left == true)
            signvalue = -0.05f;
        else
            signvalue = 0.05f;

        if (Legdata.ToMid == true)
            Thighturn_ang += signvalue;
        if (Legdata.ToMid == false)
            Thighturn_ang -= signvalue;

        if (Thighturn_ang <= 25 || Thighturn_ang <= 335 && Thighturn_ang <= 180)
            Legdata.Left = true;
        if (Thighturn_ang >= 25 || Thighturn_ang >= 335 && Thighturn_ang >= 180)
            Legdata.Left = false;

        if (Thighturn_ang == 0)
            Legdata.ToMid = false;
        if (Math.Abs(Thighturn_ang) >= 25f)
            Legdata.ToMid = true;
    }

提前致谢,您的:

莫娜

4

0 回答 0