From 085cd719fadf745714dc218b08d58b7078f01c20 Mon Sep 17 00:00:00 2001 From: yugecin Date: Fri, 22 Dec 2017 12:33:51 +0100 Subject: [PATCH] fade out players after they missed --- src/yugecin/opsudance/ReplayPlayback.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/yugecin/opsudance/ReplayPlayback.java b/src/yugecin/opsudance/ReplayPlayback.java index 58794f94..6a778873 100644 --- a/src/yugecin/opsudance/ReplayPlayback.java +++ b/src/yugecin/opsudance/ReplayPlayback.java @@ -146,6 +146,7 @@ public class ReplayPlayback { private int HITIMAGETIMERFADESTART = 500; private int HITIMAGETIMERFADEEND = 700; private float HITIMAGETIMERFADEDELTA = HITIMAGETIMERFADEEND - HITIMAGETIMERFADESTART; + private int HITIMAGEDEADFADE = 15000; private void showHitImage(int renderdelta, int ypos) { if (hitImage == null) { return; @@ -162,6 +163,13 @@ public class ReplayPlayback { if (!missed && hitImageTimer > HITIMAGETIMERFADESTART) { color.a = (HITIMAGETIMERFADEEND - hitImageTimer) / HITIMAGETIMERFADEDELTA; } + if (missed) { + if (hitImageTimer > HITIMAGEDEADFADE) { + this.color.a = color.a = 0f; + } else { + this.color.a = color.a = 1f - (float) hitImageTimer / HITIMAGEDEADFADE; + } + } float scale = 1f; float offset = 0f; if (hitImageTimer < HITIMAGETIMEREXPAND) { @@ -284,7 +292,7 @@ public class ReplayPlayback { if (!missed) { result = HIT_50; } else { - ReplayPlayback.this.color = missedColor; + ReplayPlayback.this.color = new Color(missedColor); } }