fix: 0-length animations

This commit is contained in:
cha0s 2024-06-27 13:57:30 -05:00
parent d63f835ebd
commit 4bf9b8d891

View File

@ -10,6 +10,9 @@ export default class ControlMovement extends System {
tick(elapsed) { tick(elapsed) {
for (const {Sprite} of this.select('default')) { for (const {Sprite} of this.select('default')) {
if (0 === Sprite.speed) {
continue;
}
Sprite.elapsed += elapsed / Sprite.speed; Sprite.elapsed += elapsed / Sprite.speed;
while (Sprite.elapsed > 1) { while (Sprite.elapsed > 1) {
Sprite.elapsed -= 1; Sprite.elapsed -= 1;