Exemplo n.º 1
0
 private void UpdateElements()
 {
     alignment.LocalPosition = Vector2.Normalize(force) * (arrow.Width + 20);
     arrow.Rotation          = rotation;
     alignment.Rotation      = rotation;
     alignment.Scale         = MathHelperExtension.Map(force.Length(), 10f, 1140f, 1f, 0.2f);
 }
Exemplo n.º 2
0
        public void ReflectRandom()
        {
            var rotation = ExtendedGame.Random.NextDouble() * MathHelper.Pi * 2;

            rotation   = MathHelperExtension.Map(rotation, 0, MathHelper.Pi * 2, MathHelper.Pi / 6, MathHelper.Pi - MathHelper.Pi / 6);
            velocity   = new Vector2((float)Math.Cos(rotation), -(float)Math.Sin(rotation)) * speed;
            lastNormal = Vector2.Zero;
        }