1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-15 03:33:19 +08:00

Add flash effect when hitting taiko hits.

This commit is contained in:
Dean Herbert 2017-04-07 16:55:51 +09:00
parent 39175905e4
commit aa45515a7c
No known key found for this signature in database
GPG Key ID: 46D71BF4958ABB49
2 changed files with 20 additions and 1 deletions

View File

@ -6,6 +6,7 @@ using System.Linq;
using osu.Framework.Graphics;
using osu.Game.Modes.Objects.Drawables;
using osu.Game.Modes.Taiko.Judgements;
using osu.Game.Modes.Taiko.Objects.Drawables.Pieces;
using OpenTK.Input;
namespace osu.Game.Modes.Taiko.Objects.Drawables
@ -66,6 +67,10 @@ namespace osu.Game.Modes.Taiko.Objects.Drawables
{
Delay(HitObject.StartTime - Time.Current + Judgement.TimeOffset, true);
var circlePiece = MainPiece as CirclePiece;
circlePiece?.FlashBox.Flush();
switch (State)
{
case ArmedState.Idle:
@ -77,6 +82,16 @@ namespace osu.Game.Modes.Taiko.Objects.Drawables
case ArmedState.Hit:
FadeOut(600);
var flash = circlePiece?.FlashBox;
if (flash != null)
{
flash.FadeTo(0.9f);
flash.FadeOut(300);
}
FadeOut(800);
const float gravity_time = 300;
const float gravity_travel_height = 200;

View File

@ -64,6 +64,8 @@ namespace osu.Game.Modes.Taiko.Objects.Drawables.Pieces
private readonly Container background;
public Box FlashBox;
public CirclePiece(bool isStrong = false)
{
AddInternal(new Drawable[]
@ -104,11 +106,13 @@ namespace osu.Game.Modes.Taiko.Objects.Drawables.Pieces
Masking = true,
Children = new[]
{
new Box
FlashBox = new Box
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
RelativeSizeAxes = Axes.Both,
Colour = Color4.White,
BlendingMode = BlendingMode.Additive,
Alpha = 0,
AlwaysPresent = true
}