Actual speed fix
This commit is contained in:
@@ -419,15 +419,6 @@ public class NetServer implements ApplicationListener{
|
|||||||
player.con.hasDisconnected = true;
|
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)
|
@Remote(targets = Loc.client, unreliable = true)
|
||||||
public static void onClientShapshot(
|
public static void onClientShapshot(
|
||||||
Player player,
|
Player player,
|
||||||
@@ -455,8 +446,8 @@ public class NetServer implements ApplicationListener{
|
|||||||
|
|
||||||
long elapsed = Time.timeSinceMillis(connection.lastRecievedClientTime);
|
long elapsed = Time.timeSinceMillis(connection.lastRecievedClientTime);
|
||||||
|
|
||||||
float maxSpeed = boosting && !player.mech.flying ? player.mech.boostSpeed : player.mech.speed;
|
float maxSpeed = boosting && !player.mech.flying ? player.mech.compoundSpeedBoost : player.mech.compoundSpeed;
|
||||||
float maxMove = elapsed / 1000f * 60f * compound(maxSpeed, player.mech.drag) * 1.1f;
|
float maxMove = elapsed / 1000f * 60f * maxSpeed * 1.05f;
|
||||||
|
|
||||||
player.pointerX = pointerX;
|
player.pointerX = pointerX;
|
||||||
player.pointerY = pointerY;
|
player.pointerY = pointerY;
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ public class Mech extends UnlockableContent{
|
|||||||
public int itemCapacity = 30;
|
public int itemCapacity = 30;
|
||||||
public boolean turnCursor = true;
|
public boolean turnCursor = true;
|
||||||
public boolean canHeal = false;
|
public boolean canHeal = false;
|
||||||
|
public float compoundSpeed, compoundSpeedBoost;
|
||||||
|
|
||||||
public float weaponOffsetX, weaponOffsetY, engineOffset = 5f, engineSize = 2.5f;
|
public float weaponOffsetX, weaponOffsetY, engineOffset = 5f, engineSize = 2.5f;
|
||||||
public Weapon weapon;
|
public Weapon weapon;
|
||||||
@@ -69,6 +70,21 @@ public class Mech extends UnlockableContent{
|
|||||||
public void onLand(Player player){
|
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
|
@Override
|
||||||
public void displayInfo(Table table){
|
public void displayInfo(Table table){
|
||||||
ContentDisplay.displayMech(table, this);
|
ContentDisplay.displayMech(table, this);
|
||||||
|
|||||||
Reference in New Issue
Block a user