from the workshops:

Code:
// get the angle to the enemy			
			VECTOR vDirection;
			ANGLE vTargetAngle;
			vec_diff(vDirection,enemy.x,my.x);
			vec_to_angle(vTargetAngle,vDirection);
// vAngle is now the angle to the enemy.		
// Turn right or left depending on the difference
// between the current and the target pan angle			
			my.pan += time_step * sign(ang(vTargetAngle.pan - my.pan));




3D Gamestudio A8 Pro
AMD FX 8350 4.00 Ghz
16GB RAM
Gigabyte GeForce GTX 960 4GB