Пример #1
0
        private void ShowSolvedPopup()
        {
            // Show a final animation if this is the last level
            if (Model.IsLastLevel ()) {

                Sprite star1 = new Sprite (LoadTexture ("World1Star"), Sunfish.Constants.ViewLayer.Modal);
                Sprite star2 = new Sprite (LoadTexture ("World2Star"), Sunfish.Constants.ViewLayer.Modal);
                Sprite star3 = new Sprite (LoadTexture ("World3Star"), Sunfish.Constants.ViewLayer.Modal);

                ViewPositioner.ScreenCenter (star1);
                ViewPositioner.ScreenCenter (star2);
                ViewPositioner.ScreenCenter (star3);

                double starsEffectLength = 3100d;

                star1.StartEffect (new Scale (0, 10.0f, starsEffectLength));
                star1.StartEffect (new Disappear (starsEffectLength));
                star1.StartEffect (new TranslateBy (new Vector2 (PixelsWithDensity (LocksGame.ScreenWidth * 2), PixelsWithDensity (LocksGame.ScreenWidth * 2)), starsEffectLength));

                star2.StartEffect (new Scale (0, 12.0f, starsEffectLength));
                star2.StartEffect (new Disappear (starsEffectLength));
                star2.StartEffect (new TranslateBy (new Vector2 (PixelsWithDensity (LocksGame.ScreenWidth * 2), PixelsWithDensity (-LocksGame.ScreenWidth * 2)), starsEffectLength));

                star3.StartEffect (new Scale (0, 15.0f, starsEffectLength));
                star3.StartEffect (new Disappear (starsEffectLength));
                star3.StartEffect (new TranslateBy (new Vector2 (PixelsWithDensity (-LocksGame.ScreenWidth * 4), PixelsWithDensity (-LocksGame.ScreenWidth * 2)), starsEffectLength));

                AddChildView (star1);
                AddChildView (star2);
                AddChildView (star3);

            }

            LocksGame.ActiveScreen.PlaySoundEffect ("Unlocked");
            int stars = Model.LockGrid.GetStars (Moves);
            StarsView.SetStars (stars);
            StarsView.StartEffect (new Sunfish.Views.Effects.Scale (50f, 1f, 1500d));
            StarsView.StartEffect (new Sunfish.Views.Effects.Appear (1200d));
            StarsView.StartEffect (new Sunfish.Views.Effects.Rotate ((float)Math.PI * 12f, 0f, 1500d));
            SolvedPopup.TransitionAudioFilename = "SpaceHarpChord";
            SolvedPopup.Show ();
        }