mirror of
https://github.com/ppy/osu.git
synced 2024-12-16 19:33:01 +08:00
Add comments and fix bananas stopping still if not caught
This commit is contained in:
parent
3f4422429d
commit
c1c0d49bfe
@ -64,7 +64,12 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawables
|
|||||||
{
|
{
|
||||||
base.Update();
|
base.Update();
|
||||||
|
|
||||||
double preemptProgress = Math.Min(1, (Time.Current - (HitObject.StartTime - InitialLifetimeOffset)) / HitObject.TimePreempt);
|
double preemptProgress = (Time.Current - (HitObject.StartTime - InitialLifetimeOffset)) / HitObject.TimePreempt;
|
||||||
|
|
||||||
|
// Clamp scale and rotation at the point of bananas being caught, else let them freely extrapolate.
|
||||||
|
if (Result.IsHit)
|
||||||
|
preemptProgress = Math.Min(1, preemptProgress);
|
||||||
|
|
||||||
ScalingContainer.Scale = new Vector2(HitObject.Scale * (float)Interpolation.Lerp(startScale, endScale, preemptProgress));
|
ScalingContainer.Scale = new Vector2(HitObject.Scale * (float)Interpolation.Lerp(startScale, endScale, preemptProgress));
|
||||||
ScalingContainer.Rotation = (float)Interpolation.Lerp(startAngle, endAngle, preemptProgress);
|
ScalingContainer.Rotation = (float)Interpolation.Lerp(startAngle, endAngle, preemptProgress);
|
||||||
}
|
}
|
||||||
|
@ -42,6 +42,8 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawables
|
|||||||
{
|
{
|
||||||
base.Update();
|
base.Update();
|
||||||
|
|
||||||
|
// No clamping for droplets. They should be considered indefinitely spinning regardless of time.
|
||||||
|
// They also never end up on the plate, so they shouldn't stop spinning when caught.
|
||||||
double preemptProgress = (Time.Current - (HitObject.StartTime - InitialLifetimeOffset)) / (HitObject.TimePreempt + 2000);
|
double preemptProgress = (Time.Current - (HitObject.StartTime - InitialLifetimeOffset)) / (HitObject.TimePreempt + 2000);
|
||||||
ScalingContainer.Rotation = (float)Interpolation.Lerp(startRotation, startRotation + 720, preemptProgress);
|
ScalingContainer.Rotation = (float)Interpolation.Lerp(startRotation, startRotation + 720, preemptProgress);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user