I'm trying to have my player follow the mouse when the mouse button is held down but I'm having some trouble figuring it out. The motion is seemingly random.
if(Mouse.GetState().LeftButton == ButtonState.Pressed)
{
int speed = 5;
Vector2 mouse = new Vector2(Mouse.GetState().X, Mouse.GetState().Y);
Vector2 direction = mouse - player.GetPosition();
direction.Normalize();
player.SetPosition(Vector2.Add(player.GetPosition(),(direction*speed)));
}
Any ideas?