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 boolean markedDone = false;
|
||||||
public int jumpUIBegin = 0, jumpUIEnd = 0;
|
public int jumpUIBegin = 0, jumpUIEnd = 0;
|
||||||
|
|
||||||
|
private float uiHeight = 100f;
|
||||||
|
|
||||||
public JumpCurve(JumpButton button){
|
public JumpCurve(JumpButton button){
|
||||||
this.button = button;
|
this.button = button;
|
||||||
}
|
}
|
||||||
@@ -672,7 +674,8 @@ public class LCanvas extends Table{
|
|||||||
Lines.stroke(4f, button.color);
|
Lines.stroke(4f, button.color);
|
||||||
Draw.alpha(parentAlpha);
|
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
|
//square jumps
|
||||||
if(false){
|
if(false){
|
||||||
@@ -691,8 +694,8 @@ public class LCanvas extends Table{
|
|||||||
|
|
||||||
Lines.curve(
|
Lines.curve(
|
||||||
x, y,
|
x, y,
|
||||||
x + dist, y,
|
x + uiHeight, y,
|
||||||
x2 + dist, y2,
|
x2 + uiHeight, y2,
|
||||||
x2, y2,
|
x2, y2,
|
||||||
Math.max(18, (int)(Mathf.dst(x, y, x2, y2) / 6)));
|
Math.max(18, (int)(Mathf.dst(x, y, x2, y2) / 6)));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user