public override void Update(float deltaTime)
        {
            base.Update(deltaTime);

            if (burstCounter > 0)
            {
                burstTimer -= deltaTime;
                if (burstTimer <= 0f)
                {
                    Assets.pew.Play(1f, (float)rand.NextDouble() - 0.5f, 0f);

                    Vector3 direction = Vector3.Normalize(Camera.CameraPos - Position);
                    float   delta     = (float)rand.NextDouble() * 0.125f - 0.0625f;
                    direction = Vector3.Transform(direction, Mathg.RotationMatrix(delta));

                    Fire(direction);
                    burstCounter--;
                    if (burstCounter > 0)
                    {
                        burstTimer = burstDelay;
                    }
                    else
                    {
                        burstTimer = 0f;
                    }
                }
            }
        }
        protected override void Attack(Vector3 towardsTarget)
        {
            Assets.pew.Play(1f, 0f, 0f);
            Assets.pew.Play(1f, -0.5f, 0f);
            Assets.pew.Play(1f, -1f, 0f);

            for (int i = -5; i <= 5; i++)
            {
                float   delta     = i * 0.4f / 5;
                Vector3 direction = Vector3.Transform(towardsTarget, Mathg.RotationMatrix(delta));
                Fire(direction);
            }
        }
Beispiel #3
0
        protected override void Attack(Vector3 towardsTarget)
        {
            counter++;
            Assets.btsch.Play();
            float dispersion = (float)Math.Atan(0.75f);

            for (int i = 0; i < 16; i++)
            {
                float   delta     = i * 2f * (float)Math.PI / 16f + (counter % 3 - 1) * dispersion;
                Vector3 direction = Vector3.Transform(towardsTarget, Mathg.RotationMatrix(delta));
                Fire(direction, 20f);
            }
        }