fade out players after they missed

This commit is contained in:
yugecin 2017-12-22 12:33:51 +01:00
parent 3bccdc5540
commit 085cd719fa

View File

@ -146,6 +146,7 @@ public class ReplayPlayback {
private int HITIMAGETIMERFADESTART = 500; private int HITIMAGETIMERFADESTART = 500;
private int HITIMAGETIMERFADEEND = 700; private int HITIMAGETIMERFADEEND = 700;
private float HITIMAGETIMERFADEDELTA = HITIMAGETIMERFADEEND - HITIMAGETIMERFADESTART; private float HITIMAGETIMERFADEDELTA = HITIMAGETIMERFADEEND - HITIMAGETIMERFADESTART;
private int HITIMAGEDEADFADE = 15000;
private void showHitImage(int renderdelta, int ypos) { private void showHitImage(int renderdelta, int ypos) {
if (hitImage == null) { if (hitImage == null) {
return; return;
@ -162,6 +163,13 @@ public class ReplayPlayback {
if (!missed && hitImageTimer > HITIMAGETIMERFADESTART) { if (!missed && hitImageTimer > HITIMAGETIMERFADESTART) {
color.a = (HITIMAGETIMERFADEEND - hitImageTimer) / HITIMAGETIMERFADEDELTA; 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 scale = 1f;
float offset = 0f; float offset = 0f;
if (hitImageTimer < HITIMAGETIMEREXPAND) { if (hitImageTimer < HITIMAGETIMEREXPAND) {
@ -284,7 +292,7 @@ public class ReplayPlayback {
if (!missed) { if (!missed) {
result = HIT_50; result = HIT_50;
} else { } else {
ReplayPlayback.this.color = missedColor; ReplayPlayback.this.color = new Color(missedColor);
} }
} }