示例#1
0
        public void InitAnimations()
        {
            ShrinkAnimator shrinkAnimation = new ShrinkAnimator("shrink1", TimeSpan.FromSeconds(1.7));
            RotateAnimator rotateAnimator  = new RotateAnimator("rotate1", TimeSpan.FromSeconds(0.2), TimeSpan.FromSeconds(1.7));

            this.Animations.Add(shrinkAnimation);
            this.Animations.Add(rotateAnimator);

            rotateAnimator.Finished += new EventHandler(rotateAnimation_Finished);
        }
        private void initAnimations()
        {
            ShrinkAnimator shrinkAnimator = new ShrinkAnimator(TimeSpan.FromSeconds(k_AnnimationLength));
            BlinkAnimator  blinkAnimator  = new BlinkAnimator(TimeSpan.FromSeconds(k_BlinkRate), TimeSpan.FromSeconds(k_AnnimationLength));
            FadeAnimator   fadeAnimator   = new FadeAnimator(TimeSpan.FromSeconds(k_AnnimationLength));

            shrinkAnimator.Finished += gotHit;
            this.Animations.Add(shrinkAnimator);
            this.Animations.Add(blinkAnimator);
            this.Animations.Add(fadeAnimator);
        }
示例#3
0
        private void createDeathAnimator()
        {
            TimeSpan          animationLength = TimeSpan.FromSeconds(k_InvaderShrinkAndRotateAnimationTime);
            ShrinkAnimator    shrinkAnimator  = new ShrinkAnimator(animationLength);
            RotateAnimator    rotateAnimator  = new RotateAnimator(k_NumOfRotationsPerSecond, animationLength);
            CompositeAnimator deathAnimator   =
                new CompositeAnimator("Death Animator", animationLength, this, shrinkAnimator, rotateAnimator);

            this.Animations.AddWithoutEnabling(deathAnimator);
            Hit += Animations_Death;
        }
示例#4
0
        private void initAnimations()
        {
            BlinkAnimator  blinkAnimator  = new BlinkAnimator(TimeSpan.FromSeconds(0.1), TimeSpan.FromSeconds(2.2));
            FadeAnimator   fadeAnimator   = new FadeAnimator(TimeSpan.FromSeconds(2.2));
            ShrinkAnimator shrinkAnimator = new ShrinkAnimator(TimeSpan.FromSeconds(2.2));

            CompositeAnimator DestroyAnimator2 = new CompositeAnimator("DestroyMother", TimeSpan.FromSeconds(2.2), this, fadeAnimator, blinkAnimator, shrinkAnimator);

            this.Animations.Add(DestroyAnimator2);
            Animations["DestroyMother"].Finished += new EventHandler(this.destroyed_Finished);
        }
示例#5
0
        public void InitAnimations()
        {
            ShrinkAnimator  shrinkAnimator  = new ShrinkAnimator(TimeSpan.FromSeconds(2));
            BlinkAnimator   blinkAnimator   = new BlinkAnimator(TimeSpan.FromSeconds(0.3), TimeSpan.FromSeconds(2));
            FadeOutAnimator fadeoutAnimator = new FadeOutAnimator(TimeSpan.FromSeconds(2));

            fadeoutAnimator.Finished += fadeoutAnimator_Finished;
            this.Animations.Add(shrinkAnimator);
            this.Animations.Add(blinkAnimator);
            this.Animations.Add(fadeoutAnimator);
            this.Animations.Pause();
        }
示例#6
0
        public new void InitAnimations()
        {
            BlinkAnimator   blinkAnimation  = new BlinkAnimator("blink1", TimeSpan.FromSeconds(0.2), TimeSpan.FromSeconds(3));
            ShrinkAnimator  shrinkAnimation = new ShrinkAnimator("shrink1", TimeSpan.FromSeconds(3));
            FadeOutAnimator fadeoutAnimator = new FadeOutAnimator("fadeout1", TimeSpan.FromSeconds(3));

            this.Animations.Add(blinkAnimation);
            this.Animations.Add(shrinkAnimation);
            this.Animations.Add(fadeoutAnimator);

            fadeoutAnimator.Finished += new EventHandler(fadeoutAnimator_Finished);
        }
示例#7
0
        private void initAnimations()
        {
            Animations.Add(new CellAnimator(m_Comander.SecondsBetweenJumps, TimeSpan.Zero, m_TextureCellsIdx));
            ShrinkAnimator shrinkAnimator = new ShrinkAnimator("ShrinkAnimator", TimeSpan.FromSeconds(1.2));
            RotateAnimator rotateAnimator = new RotateAnimator("RotateAnimator", TimeSpan.FromSeconds(1.2), 6);

            m_DyingAnimator = new CompositeAnimator("DieAnimator", TimeSpan.FromSeconds(1.2), this, shrinkAnimator, rotateAnimator);
            m_DyingAnimator.ResetAfterFinish = false;
            Animations.Add(m_DyingAnimator);
            m_DyingAnimator.Finished += remove;
            Animations.Resume();
            m_DyingAnimator.Pause();
        }
示例#8
0
        private void createDeathAnimator()
        {
            TimeSpan          animationLength = TimeSpan.FromSeconds(k_DeathAnimatorDuration);
            TimeSpan          blinkDuration   = TimeSpan.FromSeconds(k_DeathBlinkDuration);
            ShrinkAnimator    shrinkAnimator  = new ShrinkAnimator(animationLength);
            FadeAnimator      fadeAnimator    = new FadeAnimator(animationLength);
            BlinkAnimator     blinkAnimator   = new BlinkAnimator(blinkDuration, animationLength);
            CompositeAnimator deathAnimator   = new CompositeAnimator(
                "Death Animator", animationLength, this, shrinkAnimator, fadeAnimator, blinkAnimator);

            this.Animations.Add(deathAnimator);
            Death += Animations_Death;
        }
示例#9
0
        private void initAnimations()
        {
            ShrinkAnimator    shrinker           = new ShrinkAnimator(TimeSpan.FromSeconds(1.2));
            RoataterAnimator  rotate             = new RoataterAnimator(6, TimeSpan.FromSeconds(1.2));
            CompositeAnimator dyingEnemy         = new CompositeAnimator("dyingEnemy", TimeSpan.FromSeconds(1.2), this, shrinker, rotate);
            CellAnimator      enemyCellAnimation = new CellAnimator(this.m_TimeUntilNextStepInSec, 2, TimeSpan.Zero, this.m_StartSqureIndex, true, this.m_Toggeler);

            this.Animations.Add(enemyCellAnimation);
            this.Animations.Add(dyingEnemy);

            this.PositionChanged   += new EventHandler <EventArgs>(this.cellAnimationPosition_Changed);
            dyingEnemy.Finished    += new EventHandler(this.dyingEnemy_Finished);
            this.Animations.Enabled = true;
        }
示例#10
0
        public void InitAnimations()
        {
            ShrinkAnimator shrinkAnimator = new ShrinkAnimator(TimeSpan.FromSeconds(1.5));
            RotateAnimator rotateAnimator = new RotateAnimator(5, RotateAnimator.eDirection.Right, TimeSpan.FromSeconds(1.5));
            CellAnimator   cellAnimator   = new CellAnimator(TimeSpan.FromMilliseconds(500), r_TextureStartIndex, r_TextureEndIndex, TimeSpan.Zero);

            this.Animations.Add(shrinkAnimator);
            this.Animations.Add(rotateAnimator);
            this.Animations.Add(cellAnimator);
            cellAnimator.Resume();
            shrinkAnimator.Pause();
            rotateAnimator.Pause();
            this.Animations.Resume();
            shrinkAnimator.Finished += shrinkAnimator_Finished;
        }
示例#11
0
        private void initAnimations()
        {
            m_AnimationWhenDead      = new CompositeAnimator(this, "AnimationWhenDead");
            m_AnimationChangeTexture = new CompositeAnimator(this, "ChangeTexture");
            CellAnimator   cellAnimator   = new CellAnimator(TimeSpan.FromSeconds(m_TimeToJump), k_NumOfFrames, TimeSpan.FromSeconds(0), r_EnemyType % 2, false);
            ShrinkAnimator shrinkAnimator = new ShrinkAnimator(TimeSpan.FromSeconds(k_AnnimationTime));
            RotateAnimator rotateAnimator = new RotateAnimator(TimeSpan.FromSeconds(k_AnnimationTime), k_SpinPerSec);

            m_AnimationChangeTexture.Add(cellAnimator);
            m_AnimationWhenDead.Add(shrinkAnimator);
            m_AnimationWhenDead.Add(rotateAnimator);
            shrinkAnimator.Finished += killEnemy;
            this.Animations          = m_AnimationChangeTexture;
            this.Animations.Resume();
        }
示例#12
0
        protected override void InitAnimations()
        {
            float          sixRounds      = (MathHelper.TwoPi) * 6;
            CellAnimator   celAnimation   = new CellAnimator(TimeSpan.FromSeconds(k_HalfSec), TimeSpan.Zero);
            RotateAnimator rotateAnimator = new RotateAnimator(sixRounds, TimeSpan.FromSeconds(1.2));
            ShrinkAnimator shrinkAnimator = new ShrinkAnimator(TimeSpan.FromSeconds(1.2));

            rotateAnimator.Finished += onRotatorAnimatorFinished;
            this.Animations.Add(celAnimation);
            this.Animations.Add(rotateAnimator);
            this.Animations.Add(shrinkAnimator);
            (this.Animations["RotateAnimation"] as RotateAnimator).Enabled = false;
            (this.Animations["ShrinkAnimation"] as ShrinkAnimator).Enabled = false;
            this.Animations.Enabled = true;
        }
示例#13
0
        private void initializeAnimations()
        {
            ShrinkAnimator shrinkAnimator = new ShrinkAnimator(TimeSpan.FromSeconds(k_DeathAnimationLength));
            RotateAnimator rotateAnimator = new RotateAnimator(
                k_NumOfCyclesPerSecondsInDeathAnimation,
                TimeSpan.FromSeconds(k_DeathAnimationLength));

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

            Animations.Resume();
        }
示例#14
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();
        }
        protected override void InitAnimations()
        {
            BlinkAnimator   blinkAnimator   = new BlinkAnimator(TimeSpan.FromSeconds(0.3), TimeSpan.FromSeconds(2.2));
            ShrinkAnimator  shrinkAnimator  = new ShrinkAnimator(TimeSpan.FromSeconds(2.2));
            FadeOutAnimator fadeOutAnimator = new FadeOutAnimator(TimeSpan.FromSeconds(2.2));

            this.Animations.Add(blinkAnimator);
            this.Animations.Add(shrinkAnimator);
            this.Animations.Add(fadeOutAnimator);

            (this.Animations["BlinkAnimation"] as BlinkAnimator).Enabled     = false;
            (this.Animations["ShrinkAnimation"] as ShrinkAnimator).Enabled   = false;
            (this.Animations["FadeOutAnimation"] as FadeOutAnimator).Enabled = false;

            fadeOutAnimator.Finished += onFadeOutAnimatorFinished;
            shrinkAnimator.Finished  += onShrinkAnimatorFinished;
            blinkAnimator.Finished   += onBlinkAnimatorFinished;
            this.Animations.Enabled   = true;
        }
示例#16
0
        private void initAnimations()
        {
            TimeSpan animationLength = TimeSpan.FromSeconds(0.5);

            CellAnimator celAnimation = new CellAnimator(animationLength, k_NumOfFrames, (int)CellIdx.Y, TimeSpan.Zero);

            float spinsPerSecond = MathHelper.TwoPi * 6;

            animationLength = TimeSpan.FromSeconds(1.2);

            SpinAnimator   spinner  = new SpinAnimator("Spinner", spinsPerSecond, animationLength);
            ShrinkAnimator shrinker = new ShrinkAnimator("Shrinker", animationLength);

            spinner.Finished += new EventHandler(spinner_OnDyingAnimationFinish);

            this.Animations.Add(celAnimation);
            this.Animations.Add(spinner);
            this.Animations.Add(shrinker);

            this.Animations.Enabled             = true;
            this.Animations["Spinner"].Enabled  = false;
            this.Animations["Shrinker"].Enabled = false;
        }