Legs -> Mech
This commit is contained in:
19
core/src/mindustry/entities/comp/MechComp.java
Normal file
19
core/src/mindustry/entities/comp/MechComp.java
Normal 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user