type.speed -> speed()

This commit is contained in:
DeltaNedas
2020-11-07 11:59:37 +00:00
parent 29b8db0a85
commit 7ec50fb800
8 changed files with 13 additions and 23 deletions

View File

@@ -604,13 +604,6 @@ public class DesktopInput extends InputHandler{
boolean ground = unit.isGrounded();
float strafePenalty = ground ? 1f : Mathf.lerp(1f, unit.type.strafePenalty, Angles.angleDist(unit.vel().angle(), unit.rotation()) / 180f);
float baseSpeed = unit.type.speed;
//limit speed to minimum formation speed to preserve formation
if(unit.isCommanding()){
//add a tiny multiplier to let units catch up just in case
baseSpeed = unit.minFormationSpeed * 0.95f;
}
float speed = unit.realSpeed() * strafePenalty;
float xa = Core.input.axis(Binding.move_x);

View File

@@ -857,14 +857,6 @@ public class MobileInput extends InputHandler implements GestureListener{
float attractDst = 15f;
float strafePenalty = legs ? 1f : Mathf.lerp(1f, type.strafePenalty, Angles.angleDist(unit.vel.angle(), unit.rotation) / 180f);
float baseSpeed = unit.type.speed;
//limit speed to minimum formation speed to preserve formation
if(unit.isCommanding()){
//add a tiny multiplier to let units catch up just in case
baseSpeed = unit.minFormationSpeed * 0.98f;
}
float speed = unit.realSpeed() * strafePenalty;
float range = unit.hasWeapons() ? unit.range() : 0f;
float bulletSpeed = unit.hasWeapons() ? type.weapons.first().bullet.speed : 0f;
@@ -906,7 +898,7 @@ public class MobileInput extends InputHandler implements GestureListener{
if(player.within(targetPos, attractDst)){
movement.setZero();
unit.vel.approachDelta(Vec2.ZERO, type.speed * type.accel / 2f);
unit.vel.approachDelta(Vec2.ZERO, unit.speed() * type.accel / 2f);
}
float expansion = 3f;