20 lines
584 B
Java
20 lines
584 B
Java
package mindustry.entities.comp;
|
|
|
|
import arc.math.*;
|
|
import arc.util.*;
|
|
import mindustry.annotations.Annotations.*;
|
|
import mindustry.gen.*;
|
|
|
|
@Component
|
|
abstract class MechComp implements Posc, Flyingc, Hitboxc, Unitc, Mechc, ElevationMovec{
|
|
@SyncField(false) @SyncLocal float baseRotation;
|
|
transient float walkTime;
|
|
|
|
@Override
|
|
public void update(){
|
|
float len = deltaLen();
|
|
baseRotation = Angles.moveToward(baseRotation, deltaAngle(), type().baseRotateSpeed * Mathf.clamp(len / type().speed / Time.delta) * Time.delta);
|
|
walkTime += len;
|
|
}
|
|
}
|