1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 17:23:22 +08:00

Update animations for new/old miss style and add fades

This commit is contained in:
Dean Herbert 2020-11-18 17:15:45 +09:00
parent 9d3de5bca0
commit c47e70da9b
4 changed files with 43 additions and 26 deletions

View File

@ -47,18 +47,18 @@ namespace osu.Game.Rulesets.Judgements
public virtual void PlayAnimation()
{
this.RotateTo(0);
this.MoveTo(Vector2.Zero);
switch (Result)
{
case HitResult.Miss:
this.ScaleTo(1.6f);
this.ScaleTo(1, 100, Easing.In);
this.MoveTo(Vector2.Zero);
this.MoveToOffset(new Vector2(0, 100), 800, Easing.InQuint);
this.RotateTo(0);
this.RotateTo(40, 800, Easing.InQuint);
break;
default:
@ -66,6 +66,8 @@ namespace osu.Game.Rulesets.Judgements
this.ScaleTo(1, 500, Easing.OutElastic);
break;
}
this.FadeOutFromOne(800);
}
}
}

View File

@ -5,6 +5,7 @@ using System;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Animations;
using osu.Framework.Graphics.Containers;
using osu.Framework.Utils;
using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Scoring;
using osuTK;
@ -53,9 +54,14 @@ namespace osu.Game.Skinning
animation?.GotoFrame(0);
this.RotateTo(0);
this.MoveTo(Vector2.Zero);
const double fade_in_length = 120;
const double fade_out_delay = 500;
const double fade_out_length = 600;
this.FadeInFromZero(fade_in_length);
this.Delay(fade_out_delay).FadeOut(fade_out_length);
// new style non-miss judgements show the original style temporarily, with additive colour.
if (temporaryOldStyle != null)
{
temporaryOldStyle.PlayAnimation();
@ -73,19 +79,23 @@ namespace osu.Game.Skinning
switch (result)
{
case HitResult.Miss:
mainPiece.ScaleTo(1.6f);
mainPiece.ScaleTo(1, 100, Easing.In);
this.ScaleTo(1.6f);
this.ScaleTo(1, 100, Easing.In);
mainPiece.MoveToOffset(new Vector2(0, 100), 800, Easing.InQuint);
//todo: this only applies to osu! ruleset apparently.
this.MoveTo(new Vector2(0, -2));
this.MoveToOffset(new Vector2(0, 20), fade_out_delay + fade_out_length, Easing.In);
mainPiece.RotateTo(40, 800, Easing.InQuint);
float rotation = RNG.NextSingle(-8.6f, 8.6f);
this.RotateTo(0);
this.RotateTo(rotation, fade_in_length)
.Then().RotateTo(rotation * 2, fade_out_delay + fade_out_length - fade_in_length, Easing.In);
break;
default:
const double animation_length = 1100;
mainPiece.ScaleTo(0.9f);
mainPiece.ScaleTo(1.05f, animation_length);
mainPiece.ScaleTo(1.05f, fade_out_delay + fade_out_length);
break;
}
}

View File

@ -5,9 +5,9 @@ using System;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Animations;
using osu.Framework.Graphics.Containers;
using osu.Framework.Utils;
using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Scoring;
using osuTK;
namespace osu.Game.Skinning
{
@ -34,8 +34,12 @@ namespace osu.Game.Skinning
animation?.GotoFrame(0);
this.RotateTo(0);
this.MoveTo(Vector2.Zero);
const double fade_in_length = 120;
const double fade_out_delay = 500;
const double fade_out_length = 600;
this.FadeInFromZero(fade_in_length);
this.Delay(fade_out_delay).FadeOut(fade_out_length);
// legacy judgements don't play any transforms if they are an animation.
if (animation?.FrameCount > 1)
@ -47,20 +51,21 @@ namespace osu.Game.Skinning
this.ScaleTo(1.6f);
this.ScaleTo(1, 100, Easing.In);
this.MoveToOffset(new Vector2(0, 100), 800, Easing.InQuint);
float rotation = RNG.NextSingle(-8.6f, 8.6f);
this.RotateTo(40, 800, Easing.InQuint);
this.RotateTo(0);
this.RotateTo(rotation, fade_in_length)
.Then().RotateTo(rotation * 2, fade_out_delay + fade_out_length - fade_in_length, Easing.In);
break;
default:
const double animation_length = 120;
this.ScaleTo(0.6f).Then()
.ScaleTo(1.1f, animation_length * 0.8f).Then()
.ScaleTo(1.1f, fade_in_length * 0.8f).Then()
// this is actually correct to match stable; there were overlapping transforms.
.ScaleTo(0.9f).Delay(animation_length * 0.2f)
.ScaleTo(1.1f).ScaleTo(0.9f, animation_length * 0.2f).Then()
.ScaleTo(0.95f).ScaleTo(finalScale, animation_length * 0.2f);
.ScaleTo(0.9f).Delay(fade_in_length * 0.2f)
.ScaleTo(1.1f).ScaleTo(0.9f, fade_in_length * 0.2f).Then()
.ScaleTo(0.95f).ScaleTo(finalScale, fade_in_length * 0.2f);
break;
}
}

View File

@ -373,11 +373,11 @@ namespace osu.Game.Skinning
case GameplaySkinComponent<HitResult> resultComponent:
Func<Drawable> createDrawable = () => getJudgementAnimation(resultComponent.Component);
// kind of wasteful that we throw this away, but should do for now.
if (createDrawable() != null)
{
var particles = getParticleTexture(resultComponent.Component);
if (particles != null)
return new LegacyJudgementPieceNew(resultComponent.Component, createDrawable, getParticleTexture(resultComponent.Component));
if (Configuration.LegacyVersion > 1)
return new LegacyJudgementPieceNew(resultComponent.Component, createDrawable, getParticleDrawable(resultComponent.Component));
else
return new LegacyJudgementPieceOld(resultComponent.Component, createDrawable);
}
@ -388,7 +388,7 @@ namespace osu.Game.Skinning
return this.GetAnimation(component.LookupName, false, false);
}
private Drawable getParticleTexture(HitResult result)
private Drawable getParticleDrawable(HitResult result)
{
switch (result)
{