diff --git a/osu.Desktop.VisualTests/Tests/TestCaseTaikoHitObjects.cs b/osu.Desktop.VisualTests/Tests/TestCaseTaikoHitObjects.cs
index 0204058b8a..48d7017f78 100644
--- a/osu.Desktop.VisualTests/Tests/TestCaseTaikoHitObjects.cs
+++ b/osu.Desktop.VisualTests/Tests/TestCaseTaikoHitObjects.cs
@@ -10,6 +10,7 @@ using osu.Framework.Graphics.Sprites;
using osu.Framework.Screens.Testing;
using osu.Game.Graphics;
using osu.Game.Modes.Taiko.Objects;
+using osu.Game.Modes.Taiko.Objects.Drawable;
using osu.Game.Modes.Taiko.Objects.Drawable.Pieces;
namespace osu.Desktop.VisualTests.Tests
@@ -30,7 +31,7 @@ namespace osu.Desktop.VisualTests.Tests
Reset();
});
- Add(new CentreHitCircle(new CirclePiece()
+ Add(new CentreHitCirclePiece(new CirclePiece()
{
KiaiMode = kiai
})
@@ -38,7 +39,7 @@ namespace osu.Desktop.VisualTests.Tests
Position = new Vector2(100, 100)
});
- Add(new CentreHitCircle(new StrongCirclePiece()
+ Add(new CentreHitCirclePiece(new StrongCirclePiece()
{
KiaiMode = kiai
})
@@ -106,7 +107,7 @@ namespace osu.Desktop.VisualTests.Tests
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
- TextSize = SYMBOL_INNER_SIZE,
+ TextSize = CirclePiece.SYMBOL_INNER_SIZE,
Icon = FontAwesome.fa_asterisk,
Shadow = false
});
@@ -133,34 +134,6 @@ namespace osu.Desktop.VisualTests.Tests
}
}
- private class CentreHitCircle : BaseCircle
- {
- public CentreHitCircle(CirclePiece piece)
- : base(piece)
- {
- Piece.Add(new CircularContainer
- {
- Anchor = Anchor.Centre,
- Origin = Anchor.Centre,
- Size = new Vector2(SYMBOL_INNER_SIZE),
- Masking = true,
- Children = new[]
- {
- new Box
- {
- RelativeSizeAxes = Axes.Both
- }
- }
- });
- }
-
- [BackgroundDependencyLoader]
- private void load(OsuColour colours)
- {
- Piece.AccentColour = colours.PinkDarker;
- }
- }
-
private class RimHitCircle : BaseCircle
{
public RimHitCircle(CirclePiece piece)
@@ -170,8 +143,8 @@ namespace osu.Desktop.VisualTests.Tests
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
- Size = new Vector2(SYMBOL_SIZE),
- BorderThickness = SYMBOL_BORDER,
+ Size = new Vector2(CirclePiece.SYMBOL_SIZE),
+ BorderThickness = CirclePiece.SYMBOL_BORDER,
BorderColour = Color4.White,
Masking = true,
Children = new[]
@@ -195,10 +168,6 @@ namespace osu.Desktop.VisualTests.Tests
private abstract class BaseCircle : Container
{
- protected const float SYMBOL_SIZE = TaikoHitObject.CIRCLE_RADIUS * 2f * 0.45f;
- protected const float SYMBOL_BORDER = 8;
- protected const float SYMBOL_INNER_SIZE = SYMBOL_SIZE - 2 * SYMBOL_BORDER;
-
protected readonly CirclePiece Piece;
protected BaseCircle(CirclePiece piece)
diff --git a/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs b/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs
index 395a0cab13..483c156ea5 100644
--- a/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs
+++ b/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs
@@ -6,6 +6,7 @@ using osu.Framework.Screens.Testing;
using osu.Game.Modes.Objects.Drawables;
using osu.Game.Modes.Taiko.Judgements;
using osu.Game.Modes.Taiko.Objects;
+using osu.Game.Modes.Taiko.Objects.Drawable;
using osu.Game.Modes.Taiko.UI;
namespace osu.Desktop.VisualTests.Tests
@@ -22,6 +23,15 @@ namespace osu.Desktop.VisualTests.Tests
AddButton("Hit!", addHitJudgement);
AddButton("Miss :(", addMissJudgement);
+ AddButton("Centre", () =>
+ {
+ playfield.Add(new DrawableCentreHit(new Hit
+ {
+ StartTime = Time.Current + 1000,
+ PreEmpt = 1000,
+ IsStrong = false
+ }));
+ });
Add(playfield = new TaikoPlayfield
{
diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/CentreHitCirclePiece.cs b/osu.Game.Modes.Taiko/Objects/Drawable/CentreHitCirclePiece.cs
new file mode 100644
index 0000000000..e476430aab
--- /dev/null
+++ b/osu.Game.Modes.Taiko/Objects/Drawable/CentreHitCirclePiece.cs
@@ -0,0 +1,49 @@
+using OpenTK;
+using osu.Framework.Allocation;
+using osu.Framework.Graphics;
+using osu.Framework.Graphics.Containers;
+using osu.Framework.Graphics.Sprites;
+using osu.Game.Graphics;
+using osu.Game.Modes.Taiko.Objects.Drawable.Pieces;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace osu.Game.Modes.Taiko.Objects.Drawable
+{
+ ///
+ /// A circle piece used for centre hits.
+ ///
+ public class CentreHitCirclePiece : Container
+ {
+ private CirclePiece circle;
+
+ public CentreHitCirclePiece(CirclePiece piece)
+ {
+ Add(circle = piece);
+
+ circle.Add(new CircularContainer
+ {
+ Anchor = Anchor.Centre,
+ Origin = Anchor.Centre,
+ Size = new Vector2(CirclePiece.SYMBOL_INNER_SIZE),
+ Masking = true,
+ Children = new[]
+ {
+ new Box
+ {
+ RelativeSizeAxes = Axes.Both
+ }
+ }
+ });
+ }
+
+ [BackgroundDependencyLoader]
+ private void load(OsuColour colours)
+ {
+ circle.AccentColour = colours.PinkDarker;
+ }
+ }
+}
diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableCentreHit.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableCentreHit.cs
new file mode 100644
index 0000000000..363ffdd451
--- /dev/null
+++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableCentreHit.cs
@@ -0,0 +1,17 @@
+using System.Collections.Generic;
+using OpenTK.Input;
+using osu.Game.Modes.Taiko.Objects.Drawable.Pieces;
+
+namespace osu.Game.Modes.Taiko.Objects.Drawable
+{
+ public class DrawableCentreHit : DrawableHit
+ {
+ protected override List HitKeys { get; } = new List(new Key[] { Key.F, Key.J });
+
+ public DrawableCentreHit(Hit hit)
+ : base(hit)
+ {
+ Add(new CentreHitCirclePiece(new CirclePiece()));
+ }
+ }
+}
diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs
index a3ea9e36b9..f455fc8d5b 100644
--- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs
+++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs
@@ -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
///
protected abstract List HitKeys { get; }
+ protected override Container Content => bodyContainer;
+
private readonly Hit hit;
///
@@ -23,10 +28,18 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable
///
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;
+ }
+ }
}
}
diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableStrongCentreHit.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableStrongCentreHit.cs
new file mode 100644
index 0000000000..19a1eec618
--- /dev/null
+++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableStrongCentreHit.cs
@@ -0,0 +1,17 @@
+using System.Collections.Generic;
+using OpenTK.Input;
+using osu.Game.Modes.Taiko.Objects.Drawable.Pieces;
+
+namespace osu.Game.Modes.Taiko.Objects.Drawable
+{
+ public class DrawableStrongCentreHit : DrawableStrongHit
+ {
+ protected override List HitKeys { get; } = new List(new Key[] { Key.F, Key.J });
+
+ public DrawableStrongCentreHit(Hit hit)
+ : base(hit)
+ {
+ Add(new CentreHitCirclePiece(new StrongCirclePiece()));
+ }
+ }
+}
diff --git a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj
index fa09ae2c82..1272c7b079 100644
--- a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj
+++ b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj
@@ -52,7 +52,10 @@
+
+
+