Aiming in AS2

[SIZE=2]Hi guys,

I am making a flash game, and so far I always made my player aim his gun at the cross hair with the following code:

onClipEvent(load)
{
a = 0;
b = 0;
angleA = 0;
Degrees = 0;
}

onClipEvent(enterFrame)
{
a = (_root.player._y-_root.player._height/4)-(_root.crossHair._y);
b = (_root.player._x)-(_root.crossHair._x);
angleA = Math.atan2(a, b);
Degrees = angleA/(Math.PI/180)-180;

        _rotation = Degrees;

}

However, this will make him instantly aim at everything, he can rotation as fast as the player’s mouse will go. But now I am trying to reproduce the VATS effect found in fallout 3 in a 2D flash game. When I enter vats, he would just instantly aim his gun as everything, his arm just popping in the right location. So I added this code, which gives him a certain speed at which to turn. However, this code only works for one-half of a rotation, for it cannot make up for the jump from 0 to 360. The code replaces the [/SIZE][SIZE=2]_rotation = Degrees;[/SIZE] [SIZE=2]above[/SIZE].

[SIZE=2]_rotation += (Degrees-_rotation)/6;[/SIZE]

[SIZE=2]Can someone help me here? I am trying to solve the 0 to 360 jump issue with if statements and it just isn’t working.

:pac:
[/SIZE]

[SIZE=2]
[/SIZE]