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; }
private void initAnimations() { TimeSpan animationLength = TimeSpan.FromSeconds(2.5); TimeSpan blinkLength = TimeSpan.FromSeconds((double)1 / 15); BlinkAnimator blinker = new BlinkAnimator("Blinker", blinkLength, animationLength); float spinsPerSecond = MathHelper.TwoPi * 4; SpinAnimator spinner = new SpinAnimator("Spinner", spinsPerSecond, animationLength); FadeOutAnimator fader = new FadeOutAnimator("Fader", animationLength); blinker.Finished += new EventHandler(onHitAnimationFinish); spinner.Finished += new EventHandler(onHitAnimationFinish); this.Animations.Add(blinker); this.Animations.Add(spinner); this.Animations.Add(fader); this.Animations.Enabled = true; this.Animations["Blinker"].Pause(); this.Animations["Spinner"].Enabled = false; this.Animations["Fader"].Enabled = false; }