Exemplo n.º 1
0
        protected override void UpdateMenu(bool active)
        {
            update_map_sprite();
            Cursor.update();
            Counter.update();
            Left_Page_Arrow.update();
            Right_Page_Arrow.update();

            base.UpdateMenu(active);

            if (ChangingPage)
            {
                (PageLoc.X < target_page_loc.X ? Right_Page_Arrow : Left_Page_Arrow).twirling_update();
                float distance = Math.Abs(PageLoc.X - target_page_loc.X) / 2;
                distance  = MathHelper.Clamp(MathHelper.Lerp(0, distance, ChangingPageTime / 12f), 0, distance);
                distance  = Math.Min(distance, 32);
                distance  = Math.Max(distance, 1);
                distance  = (float)Math.Pow(2, Math.Round(Math.Log(distance, 2)));
                PageLoc.X = (float)Additional_Math.double_closer(PageLoc.X, target_page_loc.X, (int)distance);

                ChangingPageTime++;
                if (PageLoc.X == target_page_loc.X)
                {
                    ChangingPage = false;
                }
            }
        }
Exemplo n.º 2
0
        public void Update(bool gameInactive)
        {
            GameInactive = gameInactive;

            if (Volume != TargetVolume)
            {
                Volume = (float)Additional_Math.double_closer(Volume, TargetVolume, 0.08f);
            }

            UpdateBgm();
            UpdateMusicEffect();

            // Play any tracks waiting to start
            PlayCuedTracks();
        }