I'm working on a 2D game. I'm trying to figure out how to determine if one Vector2 is facing the other.
Here is what I have so far:
public void update(GameTime gameTime, Vector2 playerPosition)
{
// position is "enemy" Vector2
// rotationAngle is the angle which the "enemy" is facing
// I need to determine if the "enemy" should rotate left, right, or move forward
// The goal is to have the "enemy" move towards the player
float angle = MathHelper.ToDegrees((float)Math.Atan2(playerPosition.Y - position.Y, playerPosition.X - position.X));
float rotationDegrees = MathHelper.ToDegrees(rotationAngle);
// Now what????
update(gameTime);
}