mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 03:22:54 +08:00
Fix juice stream droplets spawning in incorrect locations
Closes #2149.
This commit is contained in:
parent
18615ce8fd
commit
8d790e180d
@ -65,23 +65,47 @@ namespace osu.Game.Rulesets.Catch.Objects
|
|||||||
X = X
|
X = X
|
||||||
});
|
});
|
||||||
|
|
||||||
for (var span = 0; span < this.SpanCount(); span++)
|
double lastDropletTime = StartTime;
|
||||||
|
|
||||||
|
for (int span = 0; span < this.SpanCount(); span++)
|
||||||
{
|
{
|
||||||
var spanStartTime = StartTime + span * spanDuration;
|
var spanStartTime = StartTime + span * spanDuration;
|
||||||
var reversed = span % 2 == 1;
|
var reversed = span % 2 == 1;
|
||||||
|
|
||||||
for (var d = tickDistance; d <= length; d += tickDistance)
|
for (double d = 0; d <= length; d += tickDistance)
|
||||||
{
|
{
|
||||||
if (d > length - minDistanceFromEnd)
|
|
||||||
break;
|
|
||||||
|
|
||||||
var timeProgress = d / length;
|
var timeProgress = d / length;
|
||||||
var distanceProgress = reversed ? 1 - timeProgress : timeProgress;
|
var distanceProgress = reversed ? 1 - timeProgress : timeProgress;
|
||||||
|
|
||||||
var lastTickTime = spanStartTime + timeProgress * spanDuration;
|
double time = spanStartTime + timeProgress * spanDuration;
|
||||||
|
|
||||||
|
double tinyTickInterval = time - lastDropletTime;
|
||||||
|
while (tinyTickInterval > 100)
|
||||||
|
tinyTickInterval /= 2;
|
||||||
|
|
||||||
|
for (double t = lastDropletTime + tinyTickInterval; t < time; t += tinyTickInterval)
|
||||||
|
{
|
||||||
|
double progress = reversed ? 1 - (t - spanStartTime) / spanDuration : (t - spanStartTime) / spanDuration;
|
||||||
|
|
||||||
|
AddNested(new TinyDroplet
|
||||||
|
{
|
||||||
|
StartTime = t,
|
||||||
|
ComboColour = ComboColour,
|
||||||
|
X = X + Curve.PositionAt(progress).X / CatchPlayfield.BASE_WIDTH,
|
||||||
|
Samples = new List<SampleInfo>(Samples.Select(s => new SampleInfo
|
||||||
|
{
|
||||||
|
Bank = s.Bank,
|
||||||
|
Name = @"slidertick",
|
||||||
|
Volume = s.Volume
|
||||||
|
}))
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (d > minDistanceFromEnd && Math.Abs(d - length) > minDistanceFromEnd)
|
||||||
|
{
|
||||||
AddNested(new Droplet
|
AddNested(new Droplet
|
||||||
{
|
{
|
||||||
StartTime = lastTickTime,
|
StartTime = time,
|
||||||
ComboColour = ComboColour,
|
ComboColour = ComboColour,
|
||||||
X = X + Curve.PositionAt(distanceProgress).X / CatchPlayfield.BASE_WIDTH,
|
X = X + Curve.PositionAt(distanceProgress).X / CatchPlayfield.BASE_WIDTH,
|
||||||
Samples = new List<SampleInfo>(Samples.Select(s => new SampleInfo
|
Samples = new List<SampleInfo>(Samples.Select(s => new SampleInfo
|
||||||
@ -93,26 +117,7 @@ namespace osu.Game.Rulesets.Catch.Objects
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
double tinyTickInterval = tickDistance / length * spanDuration;
|
lastDropletTime = time;
|
||||||
while (tinyTickInterval > 100)
|
|
||||||
tinyTickInterval /= 2;
|
|
||||||
|
|
||||||
for (double t = 0; t < spanDuration; t += tinyTickInterval)
|
|
||||||
{
|
|
||||||
double progress = reversed ? 1 - t / spanDuration : t / spanDuration;
|
|
||||||
|
|
||||||
AddNested(new TinyDroplet
|
|
||||||
{
|
|
||||||
StartTime = spanStartTime + t,
|
|
||||||
ComboColour = ComboColour,
|
|
||||||
X = X + Curve.PositionAt(progress).X / CatchPlayfield.BASE_WIDTH,
|
|
||||||
Samples = new List<SampleInfo>(Samples.Select(s => new SampleInfo
|
|
||||||
{
|
|
||||||
Bank = s.Bank,
|
|
||||||
Name = @"slidertick",
|
|
||||||
Volume = s.Volume
|
|
||||||
}))
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
AddNested(new Fruit
|
AddNested(new Fruit
|
||||||
|
@ -18,7 +18,7 @@ namespace osu.Game.Rulesets.Catch.Tests
|
|||||||
{
|
{
|
||||||
protected override string ResourceAssembly => "osu.Game.Rulesets.Catch";
|
protected override string ResourceAssembly => "osu.Game.Rulesets.Catch";
|
||||||
|
|
||||||
[TestCase("basic"), Ignore("See: https://github.com/ppy/osu/issues/2149")]
|
[TestCase("basic"), Ignore("See: https://github.com/ppy/osu/issues/2232")]
|
||||||
public new void Test(string name)
|
public new void Test(string name)
|
||||||
{
|
{
|
||||||
base.Test(name);
|
base.Test(name);
|
||||||
|
Loading…
Reference in New Issue
Block a user