Esempio n. 1
0
        private void CompletionAnimation(bool playSound = true)
        {
            if (Game1.activeClickableMenu is not null && Game1.activeClickableMenu is EndgameBundleMenu bundleMenu)
            {
                bundleMenu.TakeDownBundleSpecificPage();
            }

            sprite.pingPong                = false;
            sprite.paused                  = false;
            sprite.sourceRect.X            = (int)sprite.sourceRectStartingPos.X;
            sprite.sourceRect.X           += sprite.sourceRect.Width;
            sprite.animationLength         = 15;
            sprite.interval                = 50f;
            sprite.totalNumberOfLoops      = 0;
            sprite.holdLastFrame           = true;
            sprite.endFunction             = Shake;
            sprite.extraInfoForEndBehavior = 1;

            if (complete)
            {
                sprite.sourceRect.X          += sprite.sourceRect.Width * 14;
                sprite.sourceRectStartingPos  = new Vector2(sprite.sourceRect.X, sprite.sourceRect.Y);
                sprite.currentParentTileIndex = 14;
                sprite.interval                = 0f;
                sprite.animationLength         = 1;
                sprite.extraInfoForEndBehavior = 0;
            }
            else
            {
                if (playSound)
                {
                    Game1.playSound("dwop");
                }

                bounds.Inflate(64, 64);
                EndgameBundleMenu.tempSprites.AddRange(Utility.sparkleWithinArea(bounds, 8, EndgameBundlePage.GetColorFromColorIndex(bundleColor) * 0.5f));
                bounds.Inflate(-64, -64);
            }

            complete = true;
        }
Esempio n. 2
0
        public void Shake(int extraInfo)
        {
            maxShake = (float)Math.PI * 3f / 128f;

            if (extraInfo == 1)
            {
                Game1.playSound("leafrustle");

                EndgameBundleMenu.tempSprites.Add(new TemporaryAnimatedSprite(50, sprite.position, EndgameBundlePage.GetColorFromColorIndex(bundleColor))
                {
                    motion       = new Vector2(-1f, 0.5f),
                    acceleration = new Vector2(0f, 0.02f)
                });

                EndgameBundleMenu.tempSprites.Last().sourceRect.Y++;
                EndgameBundleMenu.tempSprites.Last().sourceRect.Height--;

                EndgameBundleMenu.tempSprites.Add(new TemporaryAnimatedSprite(50, sprite.position, EndgameBundlePage.GetColorFromColorIndex(bundleColor))
                {
                    motion       = new Vector2(1f, 0.5f),
                    acceleration = new Vector2(0f, 0.02f),
                    flipped      = true,
                    delayBeforeAnimationStart = 50
                });

                EndgameBundleMenu.tempSprites.Last().sourceRect.Y++;
                EndgameBundleMenu.tempSprites.Last().sourceRect.Height--;
            }
        }