Fixed low-FPS movement getting broken
This commit is contained in:
@@ -293,7 +293,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
|
||||
float x = snappedX(), y = snappedY();
|
||||
|
||||
if(!movement.isZero() && moved && !state.isPaused()){
|
||||
walktime += Timers.delta() * movement.len() / 0.7f * getFloorOn().speedMultiplier;
|
||||
walktime += movement.len() / 0.7f * getFloorOn().speedMultiplier;
|
||||
baseRotation = Mathf.slerpDelta(baseRotation, movement.angle(), 0.13f);
|
||||
}
|
||||
|
||||
@@ -608,11 +608,11 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
|
||||
pointerY = vec.y;
|
||||
updateShooting();
|
||||
|
||||
movement.limit(speed * Timers.delta());
|
||||
movement.limit(speed).scl(Timers.delta());
|
||||
|
||||
if(getCarrier() == null){
|
||||
if(!ui.chatfrag.chatOpen()){
|
||||
velocity.add(movement);
|
||||
velocity.add(movement.x, movement.y);
|
||||
}
|
||||
float prex = x, prey = y;
|
||||
updateVelocityStatus();
|
||||
|
||||
@@ -233,7 +233,7 @@ public abstract class Unit extends DestructibleEntity implements SaveTrait, Targ
|
||||
|
||||
status.update(this);
|
||||
|
||||
velocity.limit(getMaxVelocity()).scl(status.getSpeedMultiplier());
|
||||
velocity.limit(getMaxVelocity()).scl(1f + (status.getSpeedMultiplier()-1f) * Timers.delta());
|
||||
|
||||
if(isFlying()){
|
||||
x += velocity.x * Timers.delta();
|
||||
|
||||
@@ -238,7 +238,7 @@ public abstract class GroundUnit extends BaseUnit{
|
||||
}
|
||||
|
||||
protected void patrol(){
|
||||
vec.trns(baseRotation, type.speed);
|
||||
vec.trns(baseRotation, type.speed * Timers.delta());
|
||||
velocity.add(vec.x, vec.y);
|
||||
vec.trns(baseRotation, type.hitsizeTile);
|
||||
Tile tile = world.tileWorld(x + vec.x, y + vec.y);
|
||||
|
||||
Reference in New Issue
Block a user