Example #1
0
        private void initializeAnimations()
        {
            BlinkAnimator loseLifeAnimation = new BlinkAnimator(
                "LoseLifeAnimation",
                k_NumOfBlinksInSecondInLoseLifeAnimation,
                TimeSpan.FromSeconds(k_LoseLifeAnimationLength));

            loseLifeAnimation.Finished += onFinishedLoseLifeAnimation;
            Animations.Add(loseLifeAnimation);
            loseLifeAnimation.Pause();

            RotateAnimator rotateAnimator = new RotateAnimator(
                k_NumOfCyclesPerSecondsInDeathAnimation,
                TimeSpan.FromSeconds(k_DeathAnimationLength));
            FaderAnimator faderAnimator = new FaderAnimator(TimeSpan.FromSeconds(k_DeathAnimationLength));

            this.DeathAnimation = new CompositeAnimator(
                "DeathAnimation",
                TimeSpan.FromSeconds(k_DeathAnimationLength),
                this,
                rotateAnimator,
                faderAnimator);

            Animations.Resume();
        }
Example #2
0
        private void Ship_SecondDeath(object sender, EventArgs e)
        {
            RotatorAnimator rotatorAnimator = new RotatorAnimator(k_ShipRotatePace, r_LastAnimationLenght);
            FaderAnimator   faderAnimator   = new FaderAnimator(r_LastAnimationLenght);

            m_Animations.AnimationLength = r_LastAnimationLenght;
            m_Animations.Remove("Blink");
            m_Animations.Add(faderAnimator);
            m_Animations.Add(rotatorAnimator);
            m_Animations.Enabled = false;
        }
Example #3
0
        private void initAnimations()
        {
            FaderAnimator    faderAnimator    = new FaderAnimator(r_AnimationLenght);
            ShrinkerAnimator shrinkerAnimator = new ShrinkerAnimator(r_AnimationLenght);
            BlinkAnimator    blinkAnimator    = new BlinkAnimator(r_MotherShipBlinkPace, r_AnimationLenght);

            m_Animations.AnimationLength = r_AnimationLenght;
            m_Animations.Add(faderAnimator);
            m_Animations.Add(shrinkerAnimator);
            m_Animations.Add(blinkAnimator);
            m_Animations.Finished += animations_Finished;
        }
Example #4
0
        private void initializeAnimations()
        {
            ShrinkAnimator shrinkAnimator = new ShrinkAnimator(TimeSpan.FromSeconds(k_DeathAnimationLength));
            FaderAnimator  faderAnimator  = new FaderAnimator(TimeSpan.FromSeconds(k_DeathAnimationLength));
            BlinkAnimator  blinkAnimator  = new BlinkAnimator(
                k_NumOfBlinksInASecondInDeathAnimation,
                TimeSpan.FromSeconds(k_DeathAnimationLength));

            this.DeathAnimation = new CompositeAnimator(
                "DeathAnimation",
                TimeSpan.FromSeconds(k_DeathAnimationLength),
                this,
                shrinkAnimator,
                faderAnimator,
                blinkAnimator);

            Animations.Resume();
        }