fix: fractional animation rate
This commit is contained in:
parent
f124cc07c5
commit
7f76a5a8d0
|
@ -206,7 +206,7 @@ export default () => class Mobile extends decorate(Trait) {
|
||||||
const normalized = Vector.normalize(movement);
|
const normalized = Vector.normalize(movement);
|
||||||
const saturated = Vector.saturate(movement);
|
const saturated = Vector.saturate(movement);
|
||||||
const scale = saturated[0] ? saturated[0] / normalized[0] : saturated[1] / normalized[1];
|
const scale = saturated[0] ? saturated[0] / normalized[0] : saturated[1] / normalized[1];
|
||||||
animation.frameRate = animation.originalFrameRate / Math.abs(scale);
|
this.entity.setAnimationRate(animation.originalFrameRate / Math.abs(scale));
|
||||||
}
|
}
|
||||||
this.actionMovement = movement;
|
this.actionMovement = movement;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user