This commit is contained in:
Anuken
2020-08-20 18:37:15 -04:00
parent c946b42360
commit 52489ef777
8 changed files with 35 additions and 13 deletions

View File

@@ -13,7 +13,7 @@ abstract class MechComp implements Posc, Flyingc, Hitboxc, Unitc, Mechc, Elevati
@Override
public void update(){
float len = deltaLen();
baseRotation = Angles.moveToward(baseRotation, deltaAngle(), type().baseRotateSpeed * Mathf.clamp(len / type().speed));
walkTime += Time.delta *len;
baseRotation = Angles.moveToward(baseRotation, deltaAngle(), type().baseRotateSpeed * Mathf.clamp(len / type().speed / Time.delta) * Time.delta);
walkTime += len;
}
}

View File

@@ -1,5 +1,6 @@
package mindustry.entities.comp;
import arc.math.*;
import arc.math.geom.*;
import arc.util.*;
import mindustry.annotations.Annotations.*;
@@ -18,7 +19,7 @@ abstract class VelComp implements Posc{
@Override
public void update(){
move(vel.x * Time.delta, vel.y * Time.delta);
vel.scl(1f - drag * Time.delta);
vel.scl(Mathf.clamp(1f - drag * Time.delta));
}
boolean moving(){