From eab544b49f47d2543ff25d80a281a3531f636f4e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 10 Mar 2020 16:41:08 +0900 Subject: [PATCH 1/2] Add afterimage glow when entering hyperdash --- .../TestSceneCatcherArea.cs | 5 ---- .../TestSceneHyperDash.cs | 6 ++++ osu.Game.Rulesets.Catch/UI/CatcherArea.cs | 30 ++++++++++++++----- 3 files changed, 28 insertions(+), 13 deletions(-) diff --git a/osu.Game.Rulesets.Catch.Tests/TestSceneCatcherArea.cs b/osu.Game.Rulesets.Catch.Tests/TestSceneCatcherArea.cs index df1ac4c725..0eea352603 100644 --- a/osu.Game.Rulesets.Catch.Tests/TestSceneCatcherArea.cs +++ b/osu.Game.Rulesets.Catch.Tests/TestSceneCatcherArea.cs @@ -22,11 +22,6 @@ namespace osu.Game.Rulesets.Catch.Tests { private RulesetInfo catchRuleset; - public override IReadOnlyList RequiredTypes => new[] - { - typeof(CatcherArea), - }; - public TestSceneCatcherArea() { AddSliderStep("CircleSize", 0, 8, 5, createCatcher); diff --git a/osu.Game.Rulesets.Catch.Tests/TestSceneHyperDash.cs b/osu.Game.Rulesets.Catch.Tests/TestSceneHyperDash.cs index 7a7c3f4103..30df2202f5 100644 --- a/osu.Game.Rulesets.Catch.Tests/TestSceneHyperDash.cs +++ b/osu.Game.Rulesets.Catch.Tests/TestSceneHyperDash.cs @@ -2,6 +2,7 @@ // See the LICENCE file in the repository root for full licence text. using System; +using System.Collections.Generic; using System.Linq; using NUnit.Framework; using osu.Framework.Testing; @@ -15,6 +16,11 @@ namespace osu.Game.Rulesets.Catch.Tests [TestFixture] public class TestSceneHyperDash : PlayerTestScene { + public override IReadOnlyList RequiredTypes => new[] + { + typeof(CatcherArea), + }; + public TestSceneHyperDash() : base(new CatchRuleset()) { diff --git a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs index dfeaf6e89f..cc0f41a14f 100644 --- a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs +++ b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs @@ -205,21 +205,28 @@ namespace osu.Game.Rulesets.Catch.UI if (!Trail) return; + var additive = createAdditiveSprite(HyperDashing); + + additive.FadeTo(0.4f).FadeOut(800, Easing.OutQuint); + additive.Expire(true); + + Scheduler.AddDelayed(beginTrail, HyperDashing ? 25 : 50); + } + + private Drawable createAdditiveSprite(bool hyperDash) + { var additive = createCatcherSprite(); additive.Anchor = Anchor; additive.Scale = Scale; - additive.Colour = HyperDashing ? Color4.Red : Color4.White; + additive.Colour = hyperDash ? Color4.Red : Color4.White; additive.Blending = BlendingParameters.Additive; additive.RelativePositionAxes = RelativePositionAxes; additive.Position = Position; AdditiveTarget.Add(additive); - additive.FadeTo(0.4f).FadeOut(800, Easing.OutQuint); - additive.Expire(true); - - Scheduler.AddDelayed(beginTrail, HyperDashing ? 25 : 50); + return additive; } private Drawable createCatcherSprite() => new CatcherSprite(); @@ -311,14 +318,14 @@ namespace osu.Game.Rulesets.Catch.UI { const float hyper_dash_transition_length = 180; - bool previouslyHyperDashing = HyperDashing; + bool wasHyperDashing = HyperDashing; if (modifier <= 1 || X == targetPosition) { hyperDashModifier = 1; hyperDashDirection = 0; - if (previouslyHyperDashing) + if (wasHyperDashing) { this.FadeColour(Color4.White, hyper_dash_transition_length, Easing.OutQuint); this.FadeTo(1, hyper_dash_transition_length, Easing.OutQuint); @@ -331,11 +338,18 @@ namespace osu.Game.Rulesets.Catch.UI hyperDashDirection = Math.Sign(targetPosition - X); hyperDashTargetPosition = targetPosition; - if (!previouslyHyperDashing) + if (!wasHyperDashing) { this.FadeColour(Color4.OrangeRed, hyper_dash_transition_length, Easing.OutQuint); this.FadeTo(0.2f, hyper_dash_transition_length, Easing.OutQuint); Trail = true; + + var hyperDashEndGlow = createAdditiveSprite(true); + + hyperDashEndGlow.MoveToOffset(new Vector2(0, -20), 1200, Easing.In); + hyperDashEndGlow.ScaleTo(hyperDashEndGlow.Scale * 0.9f).ScaleTo(hyperDashEndGlow.Scale * 1.2f, 1200, Easing.In); + hyperDashEndGlow.FadeOut(1200); + hyperDashEndGlow.Expire(true); } } } From 8ad44952f8da454f5d8d77172b6615099f86ebe0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 10 Mar 2020 16:47:53 +0900 Subject: [PATCH 2/2] Remove unused usings --- osu.Game.Rulesets.Catch.Tests/TestSceneCatcherArea.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/osu.Game.Rulesets.Catch.Tests/TestSceneCatcherArea.cs b/osu.Game.Rulesets.Catch.Tests/TestSceneCatcherArea.cs index 0eea352603..cf4843c200 100644 --- a/osu.Game.Rulesets.Catch.Tests/TestSceneCatcherArea.cs +++ b/osu.Game.Rulesets.Catch.Tests/TestSceneCatcherArea.cs @@ -1,8 +1,6 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -using System; -using System.Collections.Generic; using System.Linq; using NUnit.Framework; using osu.Framework.Allocation;