Legs -> Mech

This commit is contained in:
Anuken
2020-05-25 16:41:55 -04:00
parent 08af9aaa02
commit 60684b4ef9
7 changed files with 10 additions and 10 deletions

View File

@@ -0,0 +1,19 @@
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 = vel().len();
baseRotation = Angles.moveToward(baseRotation, vel().angle(), type().baseRotateSpeed * Mathf.clamp(len / type().speed));
walkTime += Time.delta()*len;
}
}