diff --git a/src/main/java/me/topchetoeu/keystrokes/engine/Fadeout.java.old b/src/main/java/me/topchetoeu/keystrokes/engine/Fadeout.java.old deleted file mode 100644 index ea1b477..0000000 --- a/src/main/java/me/topchetoeu/keystrokes/engine/Fadeout.java.old +++ /dev/null @@ -1,39 +0,0 @@ -package me.topchetoeu.keystrokes.engine; - -public class Fadeout { - public float slope; - public float duration; - - private boolean near(float f) { - return near(slope, f); - } - private boolean near(float a, float b) { - return Math.abs(a - b) < 0.001f; - } - - public float calculate(float delta) { - if (delta > duration) return 0; - - if (near(0)) return 1; - if (near(1)) return 1 - delta / duration; - if (near(2)) return 1 - (float)Math.sqrt(delta / duration); - - float pow = 1 / slope; - - if (near(pow, Math.round(pow))) { - float a = delta / duration; - float b = 1; - - for (int i = 0; i < pow; i++) b *= a; - - return 1 - b; - } - - return 1 - (float)Math.pow(delta / duration, pow); - } - - public Fadeout(float slope, float duration) { - this.slope = slope; - this.duration = duration; - } -}