Skip to content

Commit

Permalink
*Also* fix droplets
Browse files Browse the repository at this point in the history
  • Loading branch information
peppy committed Sep 17, 2024
1 parent 2ccdad4 commit 3f44224
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions osu.Game.Rulesets.Catch/Objects/Drawables/DrawableDroplet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// See the LICENCE file in the repository root for full licence text.

using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Utils;
using osu.Game.Rulesets.Catch.Skinning.Default;
using osu.Game.Skinning;

Expand All @@ -28,15 +28,22 @@ private void load()
_ => new DropletPiece());
}

protected override void UpdateInitialTransforms()
private float startRotation;

protected override void OnApply()
{
base.UpdateInitialTransforms();
base.OnApply();

// roughly matches osu-stable
float startRotation = RandomSingle(1) * 20;
double duration = HitObject.TimePreempt + 2000;
startRotation = RandomSingle(1) * 20;
}

protected override void Update()
{
base.Update();

ScalingContainer.RotateTo(startRotation).RotateTo(startRotation + 720, duration);
double preemptProgress = (Time.Current - (HitObject.StartTime - InitialLifetimeOffset)) / (HitObject.TimePreempt + 2000);
ScalingContainer.Rotation = (float)Interpolation.Lerp(startRotation, startRotation + 720, preemptProgress);
}
}
}

0 comments on commit 3f44224

Please sign in to comment.