mirror of
https://github.com/ppy/osu
synced 2025-01-13 09:31:19 +00:00
Merge pull request #13746 from ekrctb/move-caught-object-vertical-offset
Move caught object stack vertical offset logic
This commit is contained in:
commit
0fb16cb55f
@ -194,9 +194,9 @@ namespace osu.Game.Rulesets.Catch.Tests
|
|||||||
AddStep("catch more fruits", () => attemptCatch(() => new Fruit(), 9));
|
AddStep("catch more fruits", () => attemptCatch(() => new Fruit(), 9));
|
||||||
checkPlate(10);
|
checkPlate(10);
|
||||||
AddAssert("caught objects are stacked", () =>
|
AddAssert("caught objects are stacked", () =>
|
||||||
catcher.CaughtObjects.All(obj => obj.Y <= Catcher.CAUGHT_FRUIT_VERTICAL_OFFSET) &&
|
catcher.CaughtObjects.All(obj => obj.Y <= 0) &&
|
||||||
catcher.CaughtObjects.Any(obj => obj.Y == Catcher.CAUGHT_FRUIT_VERTICAL_OFFSET) &&
|
catcher.CaughtObjects.Any(obj => obj.Y == 0) &&
|
||||||
catcher.CaughtObjects.Any(obj => obj.Y < -25));
|
catcher.CaughtObjects.Any(obj => obj.Y < 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
@ -56,11 +56,6 @@ namespace osu.Game.Rulesets.Catch.UI
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public double Speed => (Dashing ? 1 : 0.5) * BASE_SPEED * hyperDashModifier;
|
public double Speed => (Dashing ? 1 : 0.5) * BASE_SPEED * hyperDashModifier;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The amount by which caught fruit should be offset from the plate surface to make them look visually "caught".
|
|
||||||
/// </summary>
|
|
||||||
public const float CAUGHT_FRUIT_VERTICAL_OFFSET = -5;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The amount by which caught fruit should be scaled down to fit on the plate.
|
/// The amount by which caught fruit should be scaled down to fit on the plate.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -157,6 +152,8 @@ namespace osu.Game.Rulesets.Catch.UI
|
|||||||
{
|
{
|
||||||
Anchor = Anchor.TopCentre,
|
Anchor = Anchor.TopCentre,
|
||||||
Origin = Anchor.BottomCentre,
|
Origin = Anchor.BottomCentre,
|
||||||
|
// offset fruit vertically to better place "above" the plate.
|
||||||
|
Y = -5
|
||||||
},
|
},
|
||||||
body = new SkinnableCatcher(),
|
body = new SkinnableCatcher(),
|
||||||
hitExplosionContainer = new HitExplosionContainer
|
hitExplosionContainer = new HitExplosionContainer
|
||||||
@ -388,9 +385,6 @@ namespace osu.Game.Rulesets.Catch.UI
|
|||||||
float adjustedRadius = displayRadius * lenience_adjust;
|
float adjustedRadius = displayRadius * lenience_adjust;
|
||||||
float checkDistance = MathF.Pow(adjustedRadius, 2);
|
float checkDistance = MathF.Pow(adjustedRadius, 2);
|
||||||
|
|
||||||
// offset fruit vertically to better place "above" the plate.
|
|
||||||
position.Y += CAUGHT_FRUIT_VERTICAL_OFFSET;
|
|
||||||
|
|
||||||
while (caughtObjectContainer.Any(f => Vector2Extensions.DistanceSquared(f.Position, position) < checkDistance))
|
while (caughtObjectContainer.Any(f => Vector2Extensions.DistanceSquared(f.Position, position) < checkDistance))
|
||||||
{
|
{
|
||||||
position.X += RNG.NextSingle(-adjustedRadius, adjustedRadius);
|
position.X += RNG.NextSingle(-adjustedRadius, adjustedRadius);
|
||||||
|
Loading…
Reference in New Issue
Block a user