Add drawable Hits/StrongHits.

This commit is contained in:
smoogipooo
2017-03-28 10:33:23 +09:00
parent 2211c08441
commit 621bcaed59
7 changed files with 136 additions and 37 deletions

View File

@ -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;
}
}
}
}