Ejemplo n.º 1
0
 public override void Update(GameTime gameTime)
 {
   if (this.GameState.Loading || this.GameState.Paused)
     return;
   float num1 = (float) gameTime.ElapsedGameTime.TotalSeconds;
   this.StepTime += num1;
   if (this.ActiveState == ZoomOut.State.Wait)
   {
     if ((double) this.StepTime > 5.0)
     {
       this.OldSfxVol = this.SoundManager.SoundEffectVolume;
       this.ChangeState();
     }
   }
   else if (this.ActiveState == ZoomOut.State.Zooming)
   {
     IGameCameraManager cameraManager = this.CameraManager;
     double num2 = (double) cameraManager.Radius * (double) MathHelper.Lerp(1f, 1.05f, Easing.EaseIn((double) FezMath.Saturate(this.StepTime / 35f), EasingType.Quadratic));
     cameraManager.Radius = (float) num2;
     this.CameraManager.Center = Vector3.Lerp(this.CameraManager.Center, this.LevelManager.Size / 2f, Easing.EaseInOut((double) FezMath.Saturate(this.StepTime / 35f), EasingType.Sine));
     this.SoundManager.SoundEffectVolume = 1f - FezMath.Saturate(this.StepTime / 33f);
     if ((double) this.StepTime > 33.0)
       this.ChangeState();
   }
   if ((double) num1 == 0.0 || !Keyboard.GetState().IsKeyDown(Keys.R))
     return;
   this.ActiveState = ZoomOut.State.Zooming;
   this.ChangeState();
 }
Ejemplo n.º 2
0
        public override void Update(GameTime gameTime)
        {
            if (this.GameState.Loading || this.GameState.Paused)
            {
                return;
            }
            float num1 = (float)gameTime.ElapsedGameTime.TotalSeconds;

            this.StepTime += num1;
            if (this.ActiveState == ZoomOut.State.Wait)
            {
                if ((double)this.StepTime > 5.0)
                {
                    this.OldSfxVol = this.SoundManager.SoundEffectVolume;
                    this.ChangeState();
                }
            }
            else if (this.ActiveState == ZoomOut.State.Zooming)
            {
                IGameCameraManager cameraManager = this.CameraManager;
                double             num2          = (double)cameraManager.Radius * (double)MathHelper.Lerp(1f, 1.05f, Easing.EaseIn((double)FezMath.Saturate(this.StepTime / 35f), EasingType.Quadratic));
                cameraManager.Radius                = (float)num2;
                this.CameraManager.Center           = Vector3.Lerp(this.CameraManager.Center, this.LevelManager.Size / 2f, Easing.EaseInOut((double)FezMath.Saturate(this.StepTime / 35f), EasingType.Sine));
                this.SoundManager.SoundEffectVolume = 1f - FezMath.Saturate(this.StepTime / 33f);
                if ((double)this.StepTime > 33.0)
                {
                    this.ChangeState();
                }
            }
            if ((double)num1 == 0.0 || !Keyboard.GetState().IsKeyDown(Keys.R))
            {
                return;
            }
            this.ActiveState = ZoomOut.State.Zooming;
            this.ChangeState();
        }