mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-03-09 20:29:06 +07:00
Actual speed fix
This commit is contained in:
parent
d79ec83817
commit
94d245246c
@ -419,15 +419,6 @@ public class NetServer implements ApplicationListener{
|
||||
player.con.hasDisconnected = true;
|
||||
}
|
||||
|
||||
private static float compound(float speed, float drag){
|
||||
float total = 0f;
|
||||
for(int i = 0; i < 50; i++){
|
||||
total *= (1f - drag);
|
||||
total += speed;
|
||||
}
|
||||
return total;
|
||||
}
|
||||
|
||||
@Remote(targets = Loc.client, unreliable = true)
|
||||
public static void onClientShapshot(
|
||||
Player player,
|
||||
@ -455,8 +446,8 @@ public class NetServer implements ApplicationListener{
|
||||
|
||||
long elapsed = Time.timeSinceMillis(connection.lastRecievedClientTime);
|
||||
|
||||
float maxSpeed = boosting && !player.mech.flying ? player.mech.boostSpeed : player.mech.speed;
|
||||
float maxMove = elapsed / 1000f * 60f * compound(maxSpeed, player.mech.drag) * 1.1f;
|
||||
float maxSpeed = boosting && !player.mech.flying ? player.mech.compoundSpeedBoost : player.mech.compoundSpeed;
|
||||
float maxMove = elapsed / 1000f * 60f * maxSpeed * 1.05f;
|
||||
|
||||
player.pointerX = pointerX;
|
||||
player.pointerY = pointerY;
|
||||
|
@ -28,6 +28,7 @@ public class Mech extends UnlockableContent{
|
||||
public int itemCapacity = 30;
|
||||
public boolean turnCursor = true;
|
||||
public boolean canHeal = false;
|
||||
public float compoundSpeed, compoundSpeedBoost;
|
||||
|
||||
public float weaponOffsetX, weaponOffsetY, engineOffset = 5f, engineSize = 2.5f;
|
||||
public Weapon weapon;
|
||||
@ -69,6 +70,21 @@ public class Mech extends UnlockableContent{
|
||||
public void onLand(Player player){
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(){
|
||||
super.init();
|
||||
|
||||
for(int i = 0; i < 500; i++){
|
||||
compoundSpeed += speed;
|
||||
compoundSpeed *= (1f - drag);
|
||||
}
|
||||
|
||||
for(int i = 0; i < 500; i++){
|
||||
compoundSpeedBoost += boostSpeed;
|
||||
compoundSpeedBoost *= (1f - drag);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void displayInfo(Table table){
|
||||
ContentDisplay.displayMech(table, this);
|
||||
|
Loading…
Reference in New Issue
Block a user