Hi, I use this code to make a smooth rotation for the enemy:

Quote:

vec_diff(temp_dir, camera.x, my.x);
vec_to_angle(offset_angle, temp_dir);
my.pan += ang(offset_angle.pan - my.pan) * 0.2 * time_step;


The enemy rotates smoothly to the camera, after detecting the player.

This is fine. But, if the enemy is currently going on a path or only straight forward, the enemy is rotating to the player while walking in a bow.

This is also fine. But this arch is not tight enough. Is it possible to make that arch or bow tighter?

I will try to describe it with a little sketch.

P = player
E = Enemy

1: Enemy is on path or straight forward, walking away from player.

|
|
E


P


2: Enemy has detected player and is turning with the quoted code. You can see the way of the enemy on the line. (Please forget the points. They show only the distance) Watch only the line.

.___
/....\
E....|

P

But this way/arch is too wide.

It should be like:
.__
/..\
E..|

P

The turning bow is tighter.



Any idea to reach this goal?

Thanks.