mirror of
https://github.com/ppy/osu.git
synced 2025-02-14 02:43:02 +08:00
Add rim hits.
This commit is contained in:
parent
1faff828d1
commit
b7d9de57a2
@ -2,11 +2,9 @@
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
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.Screens.Testing;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Modes.Taiko.Objects.Drawable.Pieces;
|
||||
@ -29,7 +27,7 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
Reset();
|
||||
});
|
||||
|
||||
Add(new CentreHitCirclePiece(new CirclePiece()
|
||||
Add(new CentreHitCirclePiece(new CirclePiece
|
||||
{
|
||||
KiaiMode = kiai
|
||||
})
|
||||
@ -37,7 +35,7 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
Position = new Vector2(100, 100)
|
||||
});
|
||||
|
||||
Add(new CentreHitCirclePiece(new StrongCirclePiece()
|
||||
Add(new CentreHitCirclePiece(new StrongCirclePiece
|
||||
{
|
||||
KiaiMode = kiai
|
||||
})
|
||||
@ -45,7 +43,7 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
Position = new Vector2(350, 100)
|
||||
});
|
||||
|
||||
Add(new RimHitCircle(new CirclePiece()
|
||||
Add(new RimHitCirclePiece(new CirclePiece
|
||||
{
|
||||
KiaiMode = kiai
|
||||
})
|
||||
@ -53,7 +51,7 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
Position = new Vector2(100, 300)
|
||||
});
|
||||
|
||||
Add(new RimHitCircle(new StrongCirclePiece()
|
||||
Add(new RimHitCirclePiece(new StrongCirclePiece
|
||||
{
|
||||
KiaiMode = kiai
|
||||
})
|
||||
@ -61,7 +59,7 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
Position = new Vector2(350, 300)
|
||||
});
|
||||
|
||||
Add(new SwellCircle(new CirclePiece()
|
||||
Add(new SwellCircle(new CirclePiece
|
||||
{
|
||||
KiaiMode = kiai
|
||||
})
|
||||
@ -69,7 +67,7 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
Position = new Vector2(100, 500)
|
||||
});
|
||||
|
||||
Add(new SwellCircle(new StrongCirclePiece()
|
||||
Add(new SwellCircle(new StrongCirclePiece
|
||||
{
|
||||
KiaiMode = kiai
|
||||
})
|
||||
@ -77,7 +75,7 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
Position = new Vector2(350, 500)
|
||||
});
|
||||
|
||||
Add(new DrumRollCircle(new CirclePiece()
|
||||
Add(new DrumRollCircle(new CirclePiece
|
||||
{
|
||||
KiaiMode = kiai
|
||||
})
|
||||
@ -86,7 +84,7 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
Position = new Vector2(575, 100)
|
||||
});
|
||||
|
||||
Add(new DrumRollCircle(new StrongCirclePiece()
|
||||
Add(new DrumRollCircle(new StrongCirclePiece
|
||||
{
|
||||
KiaiMode = kiai
|
||||
})
|
||||
@ -132,38 +130,6 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
}
|
||||
}
|
||||
|
||||
private class RimHitCircle : BaseCircle
|
||||
{
|
||||
public RimHitCircle(CirclePiece piece)
|
||||
: base(piece)
|
||||
{
|
||||
Piece.Add(new CircularContainer
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Size = new Vector2(CirclePiece.SYMBOL_SIZE),
|
||||
BorderThickness = CirclePiece.SYMBOL_BORDER,
|
||||
BorderColour = Color4.White,
|
||||
Masking = true,
|
||||
Children = new[]
|
||||
{
|
||||
new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Alpha = 0,
|
||||
AlwaysPresent = true
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
{
|
||||
Piece.AccentColour = colours.BlueDarker;
|
||||
}
|
||||
}
|
||||
|
||||
private abstract class BaseCircle : Container
|
||||
{
|
||||
protected readonly CirclePiece Piece;
|
||||
|
@ -1,6 +1,9 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Primitives;
|
||||
using osu.Framework.MathUtils;
|
||||
using osu.Framework.Screens.Testing;
|
||||
using osu.Game.Modes.Objects.Drawables;
|
||||
@ -23,19 +26,16 @@ 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
|
||||
Add(new Container
|
||||
{
|
||||
Y = 200
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Y = 200,
|
||||
Padding = new MarginPadding { Left = 200 },
|
||||
Children = new[]
|
||||
{
|
||||
playfield = new TaikoPlayfield()
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -70,6 +70,34 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
});
|
||||
}
|
||||
|
||||
private void addCentreHit(bool strong)
|
||||
{
|
||||
Hit h = new Hit
|
||||
{
|
||||
StartTime = Time.Current + 1000,
|
||||
PreEmpt = 1000
|
||||
};
|
||||
|
||||
if (strong)
|
||||
playfield.Add(new DrawableStrongCentreHit(h));
|
||||
else
|
||||
playfield.Add(new DrawableCentreHit(h));
|
||||
}
|
||||
|
||||
private void addRimHit(bool strong)
|
||||
{
|
||||
Hit h = new Hit
|
||||
{
|
||||
StartTime = Time.Current + 1000,
|
||||
PreEmpt = 1000
|
||||
};
|
||||
|
||||
if (strong)
|
||||
playfield.Add(new DrawableStrongRimHit(h));
|
||||
else
|
||||
playfield.Add(new DrawableRimHit(h));
|
||||
}
|
||||
|
||||
private class DrawableTestHit : DrawableHitObject<TaikoHitObject, TaikoJudgement>
|
||||
{
|
||||
public DrawableTestHit(TaikoHitObject hitObject)
|
||||
|
20
osu.Game.Modes.Taiko/Objects/Drawable/DrawableRimHit.cs
Normal file
20
osu.Game.Modes.Taiko/Objects/Drawable/DrawableRimHit.cs
Normal file
@ -0,0 +1,20 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System.Collections.Generic;
|
||||
using OpenTK.Input;
|
||||
using osu.Game.Modes.Taiko.Objects.Drawable.Pieces;
|
||||
|
||||
namespace osu.Game.Modes.Taiko.Objects.Drawable
|
||||
{
|
||||
public class DrawableRimHit : DrawableHit
|
||||
{
|
||||
protected override List<Key> HitKeys { get; } = new List<Key>(new[] { Key.D, Key.K });
|
||||
|
||||
public DrawableRimHit(Hit hit)
|
||||
: base(hit)
|
||||
{
|
||||
Add(new RimHitCirclePiece(new CirclePiece()));
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System.Collections.Generic;
|
||||
using OpenTK.Input;
|
||||
using osu.Game.Modes.Taiko.Objects.Drawable.Pieces;
|
||||
|
||||
namespace osu.Game.Modes.Taiko.Objects.Drawable
|
||||
{
|
||||
public class DrawableStrongRimHit : DrawableStrongHit
|
||||
{
|
||||
protected override List<Key> HitKeys { get; } = new List<Key>(new[] { Key.D, Key.K });
|
||||
|
||||
public DrawableStrongRimHit(Hit hit)
|
||||
: base(hit)
|
||||
{
|
||||
Add(new RimHitCirclePiece(new StrongCirclePiece()));
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
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.Game.Graphics;
|
||||
|
||||
namespace osu.Game.Modes.Taiko.Objects.Drawable.Pieces
|
||||
{
|
||||
public class RimHitCirclePiece : Container
|
||||
{
|
||||
private readonly CirclePiece circle;
|
||||
|
||||
public RimHitCirclePiece(CirclePiece piece)
|
||||
{
|
||||
Add(circle = piece);
|
||||
|
||||
circle.Add(new CircularContainer
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Size = new Vector2(CirclePiece.SYMBOL_SIZE),
|
||||
BorderThickness = CirclePiece.SYMBOL_BORDER,
|
||||
BorderColour = Color4.White,
|
||||
Masking = true,
|
||||
Children = new[]
|
||||
{
|
||||
new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Alpha = 0,
|
||||
AlwaysPresent = true
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
{
|
||||
circle.AccentColour = colours.BlueDarker;
|
||||
}
|
||||
}
|
||||
}
|
@ -52,11 +52,14 @@
|
||||
<Compile Include="Judgements\TaikoDrumRollTickJudgement.cs" />
|
||||
<Compile Include="Judgements\TaikoJudgement.cs" />
|
||||
<Compile Include="Judgements\TaikoHitResult.cs" />
|
||||
<Compile Include="Objects\Drawable\DrawableRimHit.cs" />
|
||||
<Compile Include="Objects\Drawable\DrawableStrongRimHit.cs" />
|
||||
<Compile Include="Objects\Drawable\Pieces\CentreHitCirclePiece.cs" />
|
||||
<Compile Include="Objects\Drawable\DrawableCentreHit.cs" />
|
||||
<Compile Include="Objects\Drawable\DrawableHit.cs" />
|
||||
<Compile Include="Objects\Drawable\DrawableStrongCentreHit.cs" />
|
||||
<Compile Include="Objects\Drawable\DrawableStrongHit.cs" />
|
||||
<Compile Include="Objects\Drawable\Pieces\RimHitCirclePiece.cs" />
|
||||
<Compile Include="Objects\Drawable\Pieces\StrongCirclePiece.cs" />
|
||||
<Compile Include="Objects\Drawable\DrawableSwell.cs" />
|
||||
<Compile Include="Objects\Drawable\DrawableTaikoHitObject.cs" />
|
||||
|
Loading…
Reference in New Issue
Block a user