ランダムな角度 (0 から 360 または 0 から 2pi の間) を選択して、その方向にスプライトを移動できるようにしたいと考えています。これまでのところ、これを試してみましたが、常に下に移動し、角度の選択があまりきれいではないため、ほとんど効果がありませんでした.
Random rand = new Random();
//Chooses the Angle
rotation = (float)rand.NextDouble()*MathHelper.TwoPi;
//Is supposed to get a normalized movement vector that moves in the direction of that angle.
moveVector = Vector2.Normalize(new Vector2(-(float)Math.Tan(rotation), 1));