Refactor sliders to have more central position/progress calculations.

This commit is contained in:
Dean Herbert
2017-03-06 11:11:29 +09:00
parent cb002ce7af
commit 56922b66be
3 changed files with 31 additions and 9 deletions

View File

@ -102,8 +102,8 @@ namespace osu.Game.Modes.Osu.Objects.Drawables
double progress = MathHelper.Clamp((Time.Current - slider.StartTime) / slider.Duration, 0, 1);
int repeat = (int)(progress * slider.RepeatCount);
progress = (progress * slider.RepeatCount) % 1;
int repeat = slider.RepeatAt(progress);
progress = slider.CurveProgressAt(progress);
if (repeat > currentRepeat)
{
@ -112,9 +112,6 @@ namespace osu.Game.Modes.Osu.Objects.Drawables
currentRepeat = repeat;
}
if (repeat % 2 == 1)
progress = 1 - progress;
bouncer2.Position = slider.Curve.PositionAt(body.SnakedEnd ?? 0);
//todo: we probably want to reconsider this before adding scoring, but it looks and feels nice.