Smoother bridge animation start/stop
This commit is contained in:
@@ -178,7 +178,7 @@ public class ItemBridge extends Block{
|
|||||||
public int link = -1;
|
public int link = -1;
|
||||||
public IntSeq incoming = new IntSeq(false, 4);
|
public IntSeq incoming = new IntSeq(false, 4);
|
||||||
public float warmup;
|
public float warmup;
|
||||||
public float time;
|
public float time, timeSpeed;
|
||||||
public boolean wasMoved, moved;
|
public boolean wasMoved, moved;
|
||||||
public float transportCounter;
|
public float transportCounter;
|
||||||
|
|
||||||
@@ -295,7 +295,10 @@ public class ItemBridge extends Block{
|
|||||||
moved = false;
|
moved = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
time += wasMoved ? delta() : 0f;
|
//smooth out animation, so it doesn't stop/start immediately
|
||||||
|
timeSpeed = Mathf.approachDelta(timeSpeed, wasMoved ? 1f : 0f, 1f / 60f);
|
||||||
|
|
||||||
|
time += timeSpeed * delta();
|
||||||
|
|
||||||
checkIncoming();
|
checkIncoming();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user