mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Add drawable Hits/StrongHits.
This commit is contained in:
@ -2,6 +2,9 @@
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using OpenTK.Input;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Transforms;
|
||||
using osu.Game.Modes.Objects.Drawables;
|
||||
using osu.Game.Modes.Taiko.Judgements;
|
||||
using System;
|
||||
@ -16,6 +19,8 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable
|
||||
/// </summary>
|
||||
protected abstract List<Key> HitKeys { get; }
|
||||
|
||||
protected override Container<Framework.Graphics.Drawable> Content => bodyContainer;
|
||||
|
||||
private readonly Hit hit;
|
||||
|
||||
/// <summary>
|
||||
@ -23,10 +28,18 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable
|
||||
/// </summary>
|
||||
private bool validKeyPressed;
|
||||
|
||||
private Container bodyContainer;
|
||||
|
||||
protected DrawableHit(Hit hit)
|
||||
: base(hit)
|
||||
{
|
||||
this.hit = hit;
|
||||
|
||||
AddInternal(bodyContainer = new Container
|
||||
{
|
||||
Anchor = Anchor.CentreLeft,
|
||||
Origin = Anchor.CentreLeft,
|
||||
});
|
||||
}
|
||||
|
||||
protected override void CheckJudgement(bool userTriggered)
|
||||
@ -63,5 +76,26 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable
|
||||
|
||||
return UpdateJudgement(true);
|
||||
}
|
||||
|
||||
protected override void UpdateState(ArmedState state)
|
||||
{
|
||||
switch (State)
|
||||
{
|
||||
case ArmedState.Idle:
|
||||
break;
|
||||
case ArmedState.Miss:
|
||||
bodyContainer.FadeOut(100);
|
||||
break;
|
||||
case ArmedState.Hit:
|
||||
bodyContainer.ScaleTo(0.8f, 400, EasingTypes.OutQuad);
|
||||
bodyContainer.FadeOut(600, EasingTypes.OutQuint);
|
||||
bodyContainer.MoveToY(-200, 250, EasingTypes.Out);
|
||||
|
||||
bodyContainer.Delay(250);
|
||||
|
||||
bodyContainer.MoveToY(0, 500, EasingTypes.In);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user