mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 23:53:51 +09:00
Particles.
This commit is contained in:
@ -21,6 +21,8 @@ using osu.Framework.Input;
|
|||||||
using OpenTK.Input;
|
using OpenTK.Input;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
|
using System;
|
||||||
|
using osu.Framework.MathUtils;
|
||||||
|
|
||||||
namespace osu.Game.Overlays
|
namespace osu.Game.Overlays
|
||||||
{
|
{
|
||||||
@ -144,6 +146,13 @@ namespace osu.Game.Overlays
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void Update()
|
||||||
|
{
|
||||||
|
base.Update();
|
||||||
|
|
||||||
|
Add(new MedalParticle(RNG.Next(0, 359)));
|
||||||
|
}
|
||||||
|
|
||||||
protected override void PopIn()
|
protected override void PopIn()
|
||||||
{
|
{
|
||||||
base.PopIn();
|
base.PopIn();
|
||||||
@ -225,5 +234,36 @@ namespace osu.Game.Overlays
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private class MedalParticle : CircularContainer
|
||||||
|
{
|
||||||
|
private readonly float direction;
|
||||||
|
|
||||||
|
private Vector2 positionForOffset(float offset) => new Vector2((float)(offset * Math.Sin(direction)), (float)(offset * Math.Cos(direction)));
|
||||||
|
|
||||||
|
public MedalParticle(float direction)
|
||||||
|
{
|
||||||
|
this.direction = direction;
|
||||||
|
Anchor = Anchor.Centre;
|
||||||
|
Origin = Anchor.Centre;
|
||||||
|
Position = positionForOffset(DISC_SIZE / 2);
|
||||||
|
Masking = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load(OsuColour colours)
|
||||||
|
{
|
||||||
|
EdgeEffect = new EdgeEffectParameters
|
||||||
|
{
|
||||||
|
Type = EdgeEffectType.Glow,
|
||||||
|
Colour = colours.Blue.Opacity(0.5f),
|
||||||
|
Radius = 5,
|
||||||
|
};
|
||||||
|
|
||||||
|
MoveTo(positionForOffset(DISC_SIZE / 2 + 200), 500);
|
||||||
|
FadeOut(500);
|
||||||
|
Expire();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user