Files
Mindustry/core/src/mindustry/entities/def/LegsComp.java
2020-05-19 14:58:04 -04:00

22 lines
571 B
Java

package mindustry.entities.def;
import arc.math.*;
import arc.util.*;
import mindustry.annotations.Annotations.*;
import mindustry.gen.*;
@Component
abstract class LegsComp implements Posc, Flyingc, Hitboxc, Unitc, Legsc, ElevationMovec{
@Import float x, y;
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*2f;
}
}