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 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);
}
}