mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-03-06 07:30:35 +07:00
Smoother bridge animation start/stop
This commit is contained in:
parent
a36f872b61
commit
296f9b9da5
@ -178,7 +178,7 @@ public class ItemBridge extends Block{
|
||||
public int link = -1;
|
||||
public IntSeq incoming = new IntSeq(false, 4);
|
||||
public float warmup;
|
||||
public float time;
|
||||
public float time, timeSpeed;
|
||||
public boolean wasMoved, moved;
|
||||
public float transportCounter;
|
||||
|
||||
@ -295,7 +295,10 @@ public class ItemBridge extends Block{
|
||||
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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user