-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Taiko Playfield Implementation #517
Merged
Merged
Changes from 13 commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
58be454
Late-add the HitObjects container in the Playfield.
smoogipoo 27a21cd
Add taiko playfield.
smoogipoo 10ed6ef
Move TaikoPlayfield to separate file.
smoogipoo 9b5cb7e
Merge branch 'taiko_judgement_scoring' into taiko_playfield_2
smoogipoo 4c398b1
Add explosion rings.
smoogipoo 1ac9898
Add judgement texts.
smoogipoo 4e7a44c
Add license + general fixes.
smoogipoo eec4a1b
Redesign HitTarget.
smoogipoo 60e866a
Increase RingExplosion base size for finishers.
smoogipoo 2cfab75
Remove now unnecessary field.
smoogipoo aac4f24
10% chance to get finisher hits in testcase.
smoogipoo 7cb2377
Add a 1px offset for the playfield border.
smoogipoo e2b510f
Add comments.
smoogipoo 259ed03
Reduce some container nesting.
smoogipoo afcd42b
Merge remote-tracking branch 'origin/master' into taiko_playfield_2
smoogipoo b769c43
Update framework.
smoogipoo e7a9307
Fix post-merge errors.
smoogipoo 8f6cee2
Override is unnecessary.
smoogipoo 790997d
Merge remote-tracking branch 'origin/master' into taiko_playfield_2
smoogipoo 9c325dd
Cleanups + fix CircularContainer usages.
smoogipoo 2c580f4
Merge branch 'master' into taiko_playfield_2
smoogipoo 8b71d70
Add a way to get the score string from JugementInfo.
smoogipoo c9fe9e6
Make judgement text generic to be used between game modes.
smoogipoo 39ff026
Reimplement JudgementText with the new DrawableJudgementInfo.
smoogipoo 7f33e10
Renaming + don't use List.
smoogipoo 00054f1
Comment out unused container for now.
smoogipoo cedcab1
s/Ring/Hit + privatize Judgement inside RingExplosion.
smoogipoo aa2b22f
Fix usings.
smoogipoo 8e1eef2
Fix some lone newlines.
smoogipoo d441114
Merge branch 'master' into taiko_playfield_2
peppy 9a3fd8b
Add readonly attributes.
peppy acfa4a4
JudgementText -> DrawableTaikoJudgementInfo.
peppy 02fba00
Tidy up and tweak transitions of DrawableJudgementInfo.
peppy b83db18
HitExplosion -> DrawableOsuJudgementInfo.
peppy 1af17fc
Remove cross-reference to osu.Game.Modes.Osu from Taiko.
peppy ef8830a
Adjust InputDrum's appearance a touch.
peppy ebb64e0
Add constant for HitTarget line thickness and make slightly thicker (…
peppy 0863efb
Remove unused variable.
peppy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
// 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.MathUtils; | ||
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.UI; | ||
|
||
namespace osu.Desktop.VisualTests.Tests | ||
{ | ||
internal class TestCaseTaikoPlayfield : TestCase | ||
{ | ||
public override string Description => "Taiko playfield"; | ||
|
||
private TaikoPlayfield playfield; | ||
|
||
public override void Reset() | ||
{ | ||
base.Reset(); | ||
|
||
AddButton("Hit!", addHitJudgement); | ||
AddButton("Miss :(", addMissJudgement); | ||
|
||
Add(playfield = new TaikoPlayfield | ||
{ | ||
Y = 200 | ||
}); | ||
} | ||
|
||
private void addHitJudgement() | ||
{ | ||
TaikoScoreResult score = RNG.Next(2) == 0 ? TaikoScoreResult.Good : TaikoScoreResult.Great; | ||
|
||
playfield.OnJudgement(new DrawableTestHit(new TaikoHitObject()) | ||
{ | ||
X = RNG.NextSingle(score == TaikoScoreResult.Good ? -0.1f : -0.05f, score == TaikoScoreResult.Good ? 0.1f : 0.05f), | ||
Judgement = new TaikoJudgementInfo | ||
{ | ||
Result = HitResult.Hit, | ||
Score = score, | ||
TimeOffset = 0, | ||
ComboAtHit = 1, | ||
SecondHit = RNG.Next(10) == 0 | ||
} | ||
}); | ||
} | ||
|
||
private void addMissJudgement() | ||
{ | ||
playfield.OnJudgement(new DrawableTestHit(new TaikoHitObject()) | ||
{ | ||
Judgement = new TaikoJudgementInfo | ||
{ | ||
Result = HitResult.Miss, | ||
TimeOffset = 0, | ||
ComboAtHit = 0 | ||
} | ||
}); | ||
} | ||
|
||
private class DrawableTestHit : DrawableHitObject<TaikoHitObject, TaikoJudgementInfo> | ||
{ | ||
public DrawableTestHit(TaikoHitObject hitObject) | ||
: base(hitObject) | ||
{ | ||
} | ||
|
||
protected override TaikoJudgementInfo CreateJudgementInfo() => new TaikoJudgementInfo(); | ||
|
||
protected override void UpdateState(ArmedState state) | ||
{ | ||
} | ||
|
||
protected override void Update() | ||
{ | ||
// Doesn't move | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>. | ||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE | ||
|
||
namespace osu.Game.Modes.Taiko.Judgements | ||
{ | ||
public enum TaikoScoreResult | ||
{ | ||
Good, | ||
Great | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
// 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.Graphics; | ||
using osu.Framework.Graphics.Containers; | ||
using osu.Framework.Graphics.Sprites; | ||
using osu.Game.Modes.Taiko.Objects; | ||
|
||
namespace osu.Game.Modes.Taiko.UI | ||
{ | ||
internal class HitTarget : Container | ||
{ | ||
private const float normal_diameter = TaikoHitObject.CIRCLE_RADIUS * 2 * TaikoPlayfield.PLAYFIELD_SCALE; | ||
private const float finisher_diameter = normal_diameter * 1.5f; | ||
private const float border_offset = 1; | ||
This comment was marked as off-topic.
Sorry, something went wrong. |
||
|
||
public HitTarget() | ||
{ | ||
RelativeSizeAxes = Axes.Y; | ||
|
||
Children = new Drawable[] | ||
{ | ||
new Box | ||
{ | ||
Name = "Bar Upper", | ||
|
||
Anchor = Anchor.TopCentre, | ||
Origin = Anchor.TopCentre, | ||
|
||
Y = border_offset, | ||
|
||
Size = new Vector2(3, (TaikoPlayfield.PlayfieldHeight - finisher_diameter) / 2f - border_offset), | ||
|
||
Alpha = 0.1f | ||
}, | ||
new CircularContainer | ||
{ | ||
Name = "Finisher Ring", | ||
|
||
Anchor = Anchor.Centre, | ||
Origin = Anchor.Centre, | ||
|
||
Size = new Vector2(finisher_diameter), | ||
|
||
BorderColour = Color4.White, | ||
BorderThickness = 2, | ||
Alpha = 0.1f, | ||
|
||
Children = new[] | ||
{ | ||
new Box | ||
{ | ||
RelativeSizeAxes = Axes.Both, | ||
|
||
Alpha = 0, | ||
AlwaysPresent = true | ||
} | ||
} | ||
}, | ||
new CircularContainer | ||
{ | ||
Name = "Normal Ring", | ||
|
||
Anchor = Anchor.Centre, | ||
Origin = Anchor.Centre, | ||
|
||
Size = new Vector2(normal_diameter), | ||
|
||
BorderColour = Color4.White, | ||
BorderThickness = 2, | ||
Alpha = 0.5f, | ||
|
||
Children = new[] | ||
{ | ||
new Box | ||
{ | ||
RelativeSizeAxes = Axes.Both, | ||
|
||
Alpha = 0, | ||
AlwaysPresent = true | ||
} | ||
} | ||
}, | ||
new Box | ||
{ | ||
Name = "Bar Lower", | ||
|
||
Anchor = Anchor.BottomCentre, | ||
Origin = Anchor.BottomCentre, | ||
|
||
Y = -border_offset, | ||
|
||
Size = new Vector2(3, (TaikoPlayfield.PlayfieldHeight - finisher_diameter) / 2f - border_offset), | ||
|
||
Alpha = 0.1f | ||
}, | ||
}; | ||
} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This comment was marked as off-topic.
Sorry, something went wrong.