mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 00:40:09 +09:00
Initial conversion of taiko to use ScrollingPlayfield.
This commit is contained in:
@ -12,7 +12,7 @@ using OpenTK.Input;
|
||||
|
||||
namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
||||
{
|
||||
public abstract class DrawableTaikoHitObject<TaikoHitType> : DrawableHitObject<TaikoHitObject, TaikoJudgement>
|
||||
public abstract class DrawableTaikoHitObject<TaikoHitType> : DrawableScrollingHitObject<TaikoHitObject, TaikoJudgement>
|
||||
where TaikoHitType : TaikoHitObject
|
||||
{
|
||||
/// <summary>
|
||||
@ -38,30 +38,14 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
||||
RelativeSizeAxes = Axes.Both;
|
||||
Size = new Vector2(HitObject.IsStrong ? TaikoHitObject.DEFAULT_STRONG_SIZE : TaikoHitObject.DEFAULT_SIZE);
|
||||
|
||||
RelativePositionAxes = Axes.X;
|
||||
|
||||
Add(MainPiece = CreateMainPiece());
|
||||
MainPiece.KiaiMode = HitObject.Kiai;
|
||||
|
||||
LifetimeStart = HitObject.StartTime - HitObject.ScrollTime * 2;
|
||||
}
|
||||
|
||||
protected override TaikoJudgement CreateJudgement() => new TaikoJudgement();
|
||||
|
||||
protected virtual TaikoPiece CreateMainPiece() => new CirclePiece();
|
||||
|
||||
/// <summary>
|
||||
/// Sets the scroll position of the DrawableHitObject relative to the offset between
|
||||
/// a time value and the HitObject's StartTime.
|
||||
/// </summary>
|
||||
/// <param name="time"></param>
|
||||
protected virtual void UpdateScrollPosition(double time) => X = (float)((HitObject.StartTime - time) / HitObject.ScrollTime);
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
UpdateScrollPosition(Time.Current);
|
||||
}
|
||||
|
||||
protected virtual bool HandleKeyPress(Key key) => false;
|
||||
|
||||
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
|
||||
|
Reference in New Issue
Block a user