diff --git a/js/entities/player.js b/js/entities/player.js index 4b8351e..4d06fe8 100644 --- a/js/entities/player.js +++ b/js/entities/player.js @@ -89,9 +89,10 @@ class Player extends Entity { } updateAnimation(deltaTime) { + // Update animation timer consistently this.animationTimer += deltaTime; - + /* // Only change animation frame at fixed intervals to prevent blinking if (this.animationTimer >= this.animationSpeed) { // Only update animation if actually moving horizontally @@ -105,7 +106,7 @@ class Player extends Entity { // Reset timer but keep remainder to maintain smooth timing this.animationTimer %= this.animationSpeed; } - + */ // Only update direction when it actually changes to prevent flipping if (Math.abs(this.vx) > 0.005) { const newDirection = this.vx > 0 ? 1 : -1;