mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 11:37:28 +08:00
Merge pull request #7901 from peppy/catch-droplet-rotation
Add osu!catch droplet rotation animation
This commit is contained in:
commit
aededd6699
@ -38,9 +38,51 @@ namespace osu.Game.Rulesets.Catch.Tests
|
||||
|
||||
foreach (FruitVisualRepresentation rep in Enum.GetValues(typeof(FruitVisualRepresentation)))
|
||||
AddStep($"show {rep}", () => SetContents(() => createDrawable(rep)));
|
||||
|
||||
AddStep("show droplet", () => SetContents(createDrawableDroplet));
|
||||
|
||||
AddStep("show tiny droplet", () => SetContents(createDrawableTinyDroplet));
|
||||
}
|
||||
|
||||
private DrawableFruit createDrawable(FruitVisualRepresentation rep)
|
||||
private Drawable createDrawableTinyDroplet()
|
||||
{
|
||||
var droplet = new TinyDroplet
|
||||
{
|
||||
StartTime = Clock.CurrentTime,
|
||||
Scale = 1.5f,
|
||||
};
|
||||
|
||||
return new DrawableTinyDroplet(droplet)
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
RelativePositionAxes = Axes.None,
|
||||
Position = Vector2.Zero,
|
||||
Alpha = 1,
|
||||
LifetimeStart = double.NegativeInfinity,
|
||||
LifetimeEnd = double.PositiveInfinity,
|
||||
};
|
||||
}
|
||||
|
||||
private Drawable createDrawableDroplet()
|
||||
{
|
||||
var droplet = new Droplet
|
||||
{
|
||||
StartTime = Clock.CurrentTime,
|
||||
Scale = 1.5f,
|
||||
};
|
||||
|
||||
return new DrawableDroplet(droplet)
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
RelativePositionAxes = Axes.None,
|
||||
Position = Vector2.Zero,
|
||||
Alpha = 1,
|
||||
LifetimeStart = double.NegativeInfinity,
|
||||
LifetimeEnd = double.PositiveInfinity,
|
||||
};
|
||||
}
|
||||
|
||||
private Drawable createDrawable(FruitVisualRepresentation rep)
|
||||
{
|
||||
Fruit fruit = new TestCatchFruit(rep)
|
||||
{
|
||||
|
@ -2,6 +2,8 @@
|
||||
// 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.Objects.Drawables.Pieces;
|
||||
using osu.Game.Skinning;
|
||||
|
||||
@ -25,5 +27,16 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawables
|
||||
AccentColour = { BindTarget = AccentColour }
|
||||
});
|
||||
}
|
||||
|
||||
protected override void UpdateInitialTransforms()
|
||||
{
|
||||
base.UpdateInitialTransforms();
|
||||
|
||||
// roughly matches osu-stable
|
||||
float startRotation = RNG.NextSingle() * 20;
|
||||
double duration = HitObject.TimePreempt + 2000;
|
||||
|
||||
this.RotateTo(startRotation).RotateTo(startRotation + 720, duration);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user