This commit is contained in:
Anuken
2021-08-04 13:52:17 -04:00
parent cfa844f960
commit 3be5296572
4 changed files with 19 additions and 6 deletions

View File

@@ -645,6 +645,8 @@ public class DesktopInput extends InputHandler{
if(omni){
unit.moveAt(movement);
}else{
unit.rotateMove(movement);
unit.moveAt(Tmp.v2.trns(unit.rotation, movement.len()));
//problem: actual unit rotation is controlled by velocity, but velocity is 1) unpredictable and 2) can be set to 0

View File

@@ -922,10 +922,7 @@ public class MobileInput extends InputHandler implements GestureListener{
if(omni){
unit.moveAt(movement);
}else{
unit.moveAt(Tmp.v2.trns(unit.rotation, movement.len()));
if(!movement.isZero()){
unit.rotation = Angles.moveToward(unit.rotation, movement.angle(), unit.type.rotateSpeed * Math.max(Time.delta, 1));
}
unit.rotateMove(movement);
}
//update shooting if not building + not mining