mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 07:06:35 +09:00
Add explosion rings.
This commit is contained in:
69
osu.Game.Modes.Taiko/UI/RingExplosion.cs
Normal file
69
osu.Game.Modes.Taiko/UI/RingExplosion.cs
Normal file
@ -0,0 +1,69 @@
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.Transforms;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Modes.Taiko.Judgements;
|
||||
using osu.Game.Modes.Taiko.Objects;
|
||||
|
||||
namespace osu.Game.Modes.Taiko.UI
|
||||
{
|
||||
internal class RingExplosion : CircularContainer
|
||||
{
|
||||
public TaikoScoreResult ScoreResult;
|
||||
|
||||
private Box innerFill;
|
||||
|
||||
public RingExplosion()
|
||||
{
|
||||
Size = new Vector2(TaikoHitObject.CIRCLE_RADIUS * 2);
|
||||
|
||||
Anchor = Anchor.Centre;
|
||||
Origin = Anchor.Centre;
|
||||
|
||||
RelativePositionAxes = Axes.Both;
|
||||
|
||||
BorderColour = Color4.White;
|
||||
BorderThickness = 1;
|
||||
|
||||
Alpha = 0.15f;
|
||||
|
||||
Children = new[]
|
||||
{
|
||||
innerFill = new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
{
|
||||
switch (ScoreResult)
|
||||
{
|
||||
default:
|
||||
break;
|
||||
case TaikoScoreResult.Good:
|
||||
innerFill.Colour = colours.Green;
|
||||
break;
|
||||
case TaikoScoreResult.Great:
|
||||
innerFill.Colour = colours.Blue;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
ScaleTo(5f, 1000, EasingTypes.OutQuint);
|
||||
FadeOut(500);
|
||||
|
||||
Expire();
|
||||
}
|
||||
}
|
||||
}
|
@ -47,7 +47,7 @@ namespace osu.Game.Modes.Taiko.UI
|
||||
protected override Container<Drawable> Content => hitObjectContainer;
|
||||
|
||||
private HitTarget hitTarget;
|
||||
//private Container<ExplodingRing> explosionRingContainer;
|
||||
private Container<RingExplosion> ringExplosionContainer;
|
||||
//private Container<DrawableBarLine> barLineContainer;
|
||||
//private Container<JudgementText> judgementContainer;
|
||||
|
||||
@ -103,14 +103,14 @@ namespace osu.Game.Modes.Taiko.UI
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
//explosionRingContainer = new Container<ExplodingRing>
|
||||
//{
|
||||
// Anchor = Anchor.CentreLeft,
|
||||
// Origin = Anchor.Centre,
|
||||
// Size = new Vector2(TaikoHitObject.CIRCLE_RADIUS * 2),
|
||||
// Scale = new Vector2(PLAYFIELD_SCALE),
|
||||
// BlendingMode = BlendingMode.Additive
|
||||
//},
|
||||
ringExplosionContainer = new Container<RingExplosion>
|
||||
{
|
||||
Anchor = Anchor.CentreLeft,
|
||||
Origin = Anchor.Centre,
|
||||
Size = new Vector2(TaikoHitObject.CIRCLE_RADIUS * 2),
|
||||
Scale = new Vector2(PLAYFIELD_SCALE),
|
||||
BlendingMode = BlendingMode.Additive
|
||||
},
|
||||
}
|
||||
},
|
||||
//barLineContainer = new Container<DrawableBarLine>
|
||||
@ -196,6 +196,13 @@ namespace osu.Game.Modes.Taiko.UI
|
||||
|
||||
public override void OnJudgement(DrawableHitObject<TaikoHitObject, TaikoJudgementInfo> judgedObject)
|
||||
{
|
||||
if (judgedObject.Judgement.Result == HitResult.Hit)
|
||||
{
|
||||
ringExplosionContainer.Add(new RingExplosion
|
||||
{
|
||||
ScoreResult = judgedObject.Judgement.Score
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user