More animation testing

This commit is contained in:
ThisIsALegitUsername 2023-01-30 23:21:23 +00:00
parent e7b80c834b
commit cf33e492a4
4 changed files with 11720 additions and 11701 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,21 @@
package dev.resent.animation.impl;
import dev.resent.animation.Animation;
import dev.resent.animation.Direction;
public class SmoothStepAnimation extends Animation {
public SmoothStepAnimation(int ms, double endPoint) {
super(ms, endPoint);
}
public SmoothStepAnimation(int ms, double endPoint, Direction direction) {
super(ms, endPoint, direction);
}
protected double getEquation(double x) {
double x1 = x / (double) duration; //Used to force input to range from 0 - 1
return -2 * Math.pow(x1, 3) + (3 * Math.pow(x1, 2));
}
}

View File

@ -5,8 +5,7 @@ import java.io.IOException;
import dev.resent.Resent; import dev.resent.Resent;
import dev.resent.animation.Animation; import dev.resent.animation.Animation;
import dev.resent.animation.Direction; import dev.resent.animation.Direction;
import dev.resent.animation.impl.EaseInOutQuad; import dev.resent.animation.impl.SmoothStepAnimation;
import dev.resent.animation.impl.ElasticAnimation;
import dev.resent.module.base.Mod; import dev.resent.module.base.Mod;
import dev.resent.module.setting.BooleanSetting; import dev.resent.module.setting.BooleanSetting;
import dev.resent.module.setting.ModeSetting; import dev.resent.module.setting.ModeSetting;
@ -123,7 +122,7 @@ public class ClickGUI extends GuiScreen {
} }
} }
GlUtils.startScale(((this.x) + (this.x + this.width)) / 2, ((this.y) + (this.y + this.height)) / 2, (float) introAnimation.getValue()); GlUtils.startScale((this.x + this.width)/2, (this.y + this.height) / 2, (float) introAnimation.getValue());
// background // background
drawRect(x - 10, y + 20, width + 35, height - 10, new Color(35, 39, 42, 200).getRGB()); drawRect(x - 10, y + 20, width + 35, height - 10, new Color(35, 39, 42, 200).getRGB());
@ -257,7 +256,7 @@ public class ClickGUI extends GuiScreen {
@Override @Override
public void initGui() { public void initGui() {
mc.gameSettings.loadOptions(); mc.gameSettings.loadOptions();
introAnimation = new EaseInOutQuad(750, 1); introAnimation = new SmoothStepAnimation(750, 1);
//introAnimation = new ElasticAnimation(750, 1, 3.8f, 1.35f, false); //introAnimation = new ElasticAnimation(750, 1, 3.8f, 1.35f, false);
} }