示例#1
0
        protected override void UpdateState(ArmedState state)
        {
            if (!IsLoaded)
            {
                return;
            }

            base.UpdateState(state);

            ApproachCircle.FadeOut();
            glow.FadeOut(400);

            switch (state)
            {
            case ArmedState.Idle:
                Delay(osuObject.Duration + TIME_PREEMPT);
                FadeOut(TIME_FADEOUT);

                explosion?.Expire();
                explosion = null;
                break;

            case ArmedState.Miss:
                ring.FadeOut();
                circle.FadeOut();
                number.FadeOut();
                glow.FadeOut();

                explosion?.Expire();
                explosion = null;

                Schedule(() => Add(explosion = new HitExplosion((OsuJudgementInfo)Judgement)));

                FadeOut(800);
                break;

            case ArmedState.Hit:
                const double flash_in = 30;

                flash.FadeTo(0.8f, flash_in);
                flash.Delay(flash_in);
                flash.FadeOut(100);

                explode.FadeIn(flash_in);

                Schedule(() => Add(explosion = new HitExplosion((OsuJudgementInfo)Judgement)));

                Delay(flash_in, true);

                //after the flash, we can hide some elements that were behind it
                ring.FadeOut();
                circle.FadeOut();
                number.FadeOut();

                FadeOut(800);
                ScaleTo(Scale * 1.5f, 400, EasingTypes.OutQuad);
                break;
            }
        }
示例#2
0
        protected override void UpdateState(ArmedState state)
        {
            if (!IsLoaded)
            {
                return;
            }

            base.UpdateState(state);

            ApproachCircle.FadeOut();

            double endTime  = (osuObject as IHasEndTime)?.EndTime ?? osuObject.StartTime;
            double duration = endTime - osuObject.StartTime;

            glow.Delay(duration);
            glow.FadeOut(400);

            switch (state)
            {
            case ArmedState.Idle:
                Delay(duration + TIME_PREEMPT);
                FadeOut(TIME_FADEOUT);
                Expire(true);
                break;

            case ArmedState.Miss:
                FadeOut(TIME_FADEOUT / 5);
                Expire();
                break;

            case ArmedState.Hit:
                const double flash_in = 40;

                flash.FadeTo(0.8f, flash_in);
                flash.Delay(flash_in);
                flash.FadeOut(100);

                explode.FadeIn(flash_in);

                Delay(flash_in, true);

                //after the flash, we can hide some elements that were behind it
                ring.FadeOut();
                circle.FadeOut();
                number.FadeOut();

                FadeOut(800);
                ScaleTo(Scale * 1.5f, 400, EasingTypes.OutQuad);
                Expire();
                break;
            }
        }
示例#3
0
        protected override void UpdateStateTransforms(ArmedState state)
        {
            glow.FadeOut(400);

            switch (state)
            {
            case ArmedState.Idle:
                this.Delay(HitObject.TimePreempt).FadeOut(500);

                Expire(true);

                circle.HitAction = null;

                // override lifetime end as FadeIn may have been changed externally, causing out expiration to be too early.
                LifetimeEnd = HitObject.StartTime + HitObject.HitWindows.HalfWindowFor(HitResult.Miss);
                break;

            case ArmedState.Miss:
                ApproachCircle.FadeOut(50);
                this.FadeOut(100);
                Expire();
                break;

            case ArmedState.Hit:
                ApproachCircle.FadeOut(50);

                const double flash_in = 40;
                flash.FadeTo(0.8f, flash_in)
                .Then()
                .FadeOut(100);

                explode.FadeIn(flash_in);

                using (BeginDelayedSequence(flash_in, true))
                {
                    //after the flash, we can hide some elements that were behind it
                    ring.FadeOut();
                    circle.FadeOut();
                    number.FadeOut();

                    this.FadeOut(800);
                    explodeContainer.ScaleTo(1.5f, 400, Easing.OutQuad);
                }

                Expire();
                break;
            }
        }
示例#4
0
        protected override void UpdateCurrentState(ArmedState state)
        {
            double duration = ((HitObject as IHasEndTime)?.EndTime ?? HitObject.StartTime) - HitObject.StartTime;

            using (glow.BeginDelayedSequence(duration))
                glow.FadeOut(400);

            switch (state)
            {
            case ArmedState.Idle:
                using (BeginDelayedSequence(duration + TIME_PREEMPT))
                    FadeOut(TIME_FADEOUT);
                Expire(true);
                break;

            case ArmedState.Miss:
                ApproachCircle.FadeOut(50);
                FadeOut(TIME_FADEOUT / 5);
                Expire();
                break;

            case ArmedState.Hit:
                ApproachCircle.FadeOut(50);

                const double flash_in = 40;

                flash.FadeTo(0.8f, flash_in);
                using (flash.BeginDelayedSequence(flash_in))
                    flash.FadeOut(100);

                explode.FadeIn(flash_in);

                using (BeginDelayedSequence(flash_in, true))
                {
                    //after the flash, we can hide some elements that were behind it
                    ring.FadeOut();
                    circle.FadeOut();
                    number.FadeOut();

                    FadeOut(800);
                    ScaleTo(Scale * 1.5f, 400, EasingTypes.OutQuad);
                }

                Expire();
                break;
            }
        }
示例#5
0
        protected override void UpdateState(ArmedState state)
        {
            if (!IsLoaded)
            {
                return;
            }

            Flush(true); //move to DrawableHitObject
            ApproachCircle.Flush(true);

            double t = HitTime ?? osuObject.StartTime;

            Alpha = 0;

            //sane defaults
            ring.Alpha           = circle.Alpha = number.Alpha = glow.Alpha = 1;
            ApproachCircle.Alpha = 0;
            ApproachCircle.Scale = new Vector2(2);
            explode.Alpha        = 0;
            Scale = new Vector2(0.5f); //this will probably need to be moved to DrawableHitObject at some point.

            const float preempt = 600;

            const float fadein = 400;

            Delay(t - Time.Current - preempt, true);

            FadeIn(fadein);

            ApproachCircle.FadeIn(Math.Min(fadein * 2, preempt));
            ApproachCircle.ScaleTo(0.6f, preempt);

            Delay(preempt, true);

            ApproachCircle.FadeOut();

            glow.FadeOut(400);

            switch (state)
            {
            case ArmedState.Disarmed:
                Delay(osuObject.Duration + 200);
                FadeOut(200);

                explosion?.Expire();
                explosion = null;
                break;

            case ArmedState.Armed:
                const double flash_in = 30;

                flash.FadeTo(0.8f, flash_in);
                flash.Delay(flash_in);
                flash.FadeOut(100);

                explode.FadeIn(flash_in);

                Schedule(() => Add(explosion = new HitExplosion(Judgement.Hit300)));

                Delay(flash_in, true);

                //after the flash, we can hide some elements that were behind it
                ring.FadeOut();
                circle.FadeOut();
                number.FadeOut();

                FadeOut(800);
                ScaleTo(Scale * 1.5f, 400, EasingTypes.OutQuad);
                break;
            }
        }