osu/osu.Game.Rulesets.Catch/Objects/Drawables/DrawableDroplet.cs

43 lines
1.3 KiB
C#
Raw Normal View History

// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
2018-04-13 09:19:50 +00:00
using osu.Framework.Allocation;
2020-02-19 08:55:40 +00:00
using osu.Framework.Graphics;
using osu.Framework.Utils;
using osu.Game.Rulesets.Catch.Objects.Drawables.Pieces;
2020-02-19 04:27:15 +00:00
using osu.Game.Skinning;
2018-04-13 09:19:50 +00:00
namespace osu.Game.Rulesets.Catch.Objects.Drawables
2018-04-13 09:19:50 +00:00
{
public class DrawableDroplet : PalpableCatchHitObject<Droplet>
{
public override bool StaysOnPlate => false;
2018-04-13 09:19:50 +00:00
public DrawableDroplet(Droplet h)
: base(h)
{
}
[BackgroundDependencyLoader]
private void load()
{
2020-02-21 01:01:38 +00:00
ScaleContainer.Child = new SkinnableDrawable(new CatchSkinComponent(CatchSkinComponents.Droplet), _ => new Pulp
{
Size = Size / 4,
AccentColour = { BindTarget = AccentColour }
});
}
2020-02-19 08:55:40 +00:00
protected override void UpdateInitialTransforms()
{
base.UpdateInitialTransforms();
// roughly matches osu-stable
float startRotation = RNG.NextSingle() * 20;
double duration = HitObject.TimePreempt + 2000;
ScaleContainer.RotateTo(startRotation).RotateTo(startRotation + 720, duration);
2020-02-19 08:55:40 +00:00
}
2018-04-13 09:19:50 +00:00
}
}