Leg animation not working
- by Monacraft
I am making a simple animation in XNA C# of a leg moving. This is the logic code for the thigh. It is meant to swing from 25' to 335'. However instead, it hits a point and then keeps on spinning in the other direction. Please help, here's the code:
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;
}
Thanks in advance, Yours:
Mona