1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 00:02:54 +08:00

update SliderTick calculation + more ticks in tests

math is hard >_<
This commit is contained in:
Aergwyn 2018-01-29 12:03:22 +01:00
parent 8425f3ee93
commit 373b3871f9
3 changed files with 16 additions and 5 deletions

View File

@ -137,7 +137,7 @@ namespace osu.Game.Rulesets.Osu.Objects
AddNested(new SliderTick
{
SpanIndex = span,
SliderStartTime = StartTime,
SpanStartTime = spanStartTime,
StartTime = spanStartTime + timeProgress * SpanDuration,
Position = Curve.PositionAt(distanceProgress),
StackHeight = StackHeight,

View File

@ -9,14 +9,22 @@ namespace osu.Game.Rulesets.Osu.Objects
public class SliderTick : OsuHitObject
{
public int SpanIndex { get; set; }
public double SliderStartTime { get; set; }
public double SpanStartTime { get; set; }
protected override void ApplyDefaultsToSelf(ControlPointInfo controlPointInfo, BeatmapDifficulty difficulty)
{
base.ApplyDefaultsToSelf(controlPointInfo, difficulty);
// SliderTicks appear earlier and earlier going further into a Slider.
TimePreempt = StartTime - ((StartTime - SliderStartTime) / 2 + SliderStartTime - TimeFadein * 0.66f);
double offset;
if (SpanIndex > 0)
// Adding 200 to include the offset stable used.
// This is so on repeats ticks don't appear too late to be visually processed by the player.
offset = 200;
else
offset = TimeFadein * 0.66f;
TimePreempt = (StartTime - SpanStartTime) / 2 + offset;
}
}
}

View File

@ -17,6 +17,7 @@ using OpenTK.Graphics;
using osu.Game.Rulesets.Mods;
using System.Linq;
using osu.Game.Rulesets.Osu.Objects.Drawables.Pieces;
using osu.Game.Rulesets.Objects.Types;
namespace osu.Game.Rulesets.Osu.Tests
{
@ -27,7 +28,9 @@ namespace osu.Game.Rulesets.Osu.Tests
{
typeof(SliderBall),
typeof(SliderBody),
typeof(SliderTick),
typeof(DrawableSlider),
typeof(DrawableSliderTick),
typeof(DrawableRepeatPoint),
typeof(DrawableOsuHitObject)
};
@ -131,7 +134,7 @@ namespace osu.Game.Rulesets.Osu.Tests
var cpi = new ControlPointInfo();
cpi.DifficultyPoints.Add(new DifficultyControlPoint { SpeedMultiplier = speedMultiplier });
slider.ApplyDefaults(cpi, new BeatmapDifficulty { CircleSize = circleSize });
slider.ApplyDefaults(cpi, new BeatmapDifficulty { CircleSize = circleSize, SliderTickRate = 3 });
var drawable = new DrawableSlider(slider)
{