Transition jump heights
It looks good.
This commit is contained in:
@@ -615,6 +615,8 @@ public class LCanvas extends Table{
|
||||
public boolean markedDone = false;
|
||||
public int jumpUIBegin = 0, jumpUIEnd = 0;
|
||||
|
||||
private float uiHeight = 100f;
|
||||
|
||||
public JumpCurve(JumpButton button){
|
||||
this.button = button;
|
||||
}
|
||||
@@ -672,7 +674,8 @@ public class LCanvas extends Table{
|
||||
Lines.stroke(4f, button.color);
|
||||
Draw.alpha(parentAlpha);
|
||||
|
||||
float dist = 100f + 100f * (float) predHeight;
|
||||
// exponential smoothing
|
||||
uiHeight = Mathf.lerp(100f + 100f * (float) predHeight, uiHeight, dynamicJumpHeights ? Mathf.pow(0.9f, Time.delta) : 0);
|
||||
|
||||
//square jumps
|
||||
if(false){
|
||||
@@ -691,8 +694,8 @@ public class LCanvas extends Table{
|
||||
|
||||
Lines.curve(
|
||||
x, y,
|
||||
x + dist, y,
|
||||
x2 + dist, y2,
|
||||
x + uiHeight, y,
|
||||
x2 + uiHeight, y2,
|
||||
x2, y2,
|
||||
Math.max(18, (int)(Mathf.dst(x, y, x2, y2) / 6)));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user