There must be a simple equation for this, but I can't think of it. Basically, I have an enemy that rotates 360 degrees, and I want that rotation to be affected by the player's XY movement. So, in the following GIF, I want the eel to inherit a bit of Spryke's movement when it eats Spryke. In this example, Spryke is moving right (X positive) and up (Y negative) when she gets eaten, and I'd like to rotate the eel a little clockwise to make it feel like Spryke's heft has pushed the eel up a bit, rather than the eel seeming unaffected by her movement.
Please login to see this picture.
In the next example, Spryke is moving the opposite way - a little left (X negative) and down (Y positive) - but because of the way the eel is facing, it should still move clockwise, but this time to make it feel like the eel is being pushed down.
Please login to see this picture.
So basically I need some sort of equation to consider Spryke's X & Y movement, and the eel's current angle, and output whether the eel's angle should decrease (clockwise) or increase (anticlockwise) to broadly match Spryke's direction. These eels can also come out of walls and ceilings, so an eel may appear in any of the 4 quadrants of a 360 degree circle. Can anyone help me with this please? The answer may well already be on MuddyMole's great Please login to see this link., but I can't figure out which equations I would need