Exemple #1
0
        public override void Update(GameTime gameTime)
        {
            if (Main.gameMenu)
            {
                return;
            }

            if (LongBool)
            {
                Main.isMouseLeftConsumedByUI = true;
            }

            TBARPlayer plr = TBARPlayer.Get();

            if (delay <= 0 && (scale += pulseSpeeds[(int)plr.CurrentStyleRank] * (float)gameTime.ElapsedGameTime.TotalSeconds) > 1.4f)
            {
                delay = bumpDelays[(int)plr.CurrentStyleRank];
                scale = 0.8f;
            }

            if (lastRank != plr.CurrentStyleRank)
            {
                var l = new FallingLetter(lastRank);

                var kek = Main.rand.NextBool();
                l.Position = this.GetDimensions().Position();
                l.velocity = new Vector2(kek ? -190f : 191f, -130f);
                letters.Add(l);

                if (lastRank < plr.CurrentStyleRank)
                {
                    l.haltTime = 90;
                    var slap = new SlappingLetter(plr.CurrentStyleRank)
                    {
                        Position = this.GetInnerDimensions().Position()
                    };
                    letters.Add(slap);
                }
            }

            foreach (ILetter l in letters)
            {
                l.Update(gameTime);
            }

            letters.RemoveAll(x => (x is FallingLetter y && y.Opacity <= 0) || (x is SlappingLetter z && z.scale <= 1f));

            lastRank = plr.CurrentStyleRank;

            delay -= 60 * (float)gameTime.ElapsedGameTime.TotalSeconds;

            base.Update(gameTime);
        }
Exemple #2
0
 public FallingLetter(StyleRank rank)
 {
     Opacity = 1.75f;
     Rank    = rank;
 }
Exemple #3
0
 public SlappingLetter(StyleRank rank)
 {
     scale   = 14f;
     Opacity = -0.25f;
     Rank    = rank;
 }