From 6e92e89f741f3483a217df36ef7c109db639a165 Mon Sep 17 00:00:00 2001 From: NovaFarma Dev Date: Sat, 6 Dec 2025 18:07:09 +0100 Subject: [PATCH] FAZA 2: Fix player walk animation error - use static sprite for now --- src/entities/Player.js | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/src/entities/Player.js b/src/entities/Player.js index a9251a1..4d14a37 100644 --- a/src/entities/Player.js +++ b/src/entities/Player.js @@ -27,9 +27,8 @@ class Player { } createSprite() { - // Generiraj player teksturo + // Generiraj player teksturo (static sprite) TextureGenerator.createPlayerSprite(this.scene, 'player'); - TextureGenerator.createPlayerWalkSprite(this.scene, 'player_walk'); // Kreira sprite const screenPos = this.iso.toScreen(this.gridX, this.gridY); @@ -39,18 +38,8 @@ class Player { // Depth sorting this.updateDepth(); - // Dodaj walking animacijo - if (!this.scene.anims.exists('player_walk_anim')) { - this.scene.anims.create({ - key: 'player_walk_anim', - frames: this.scene.anims.generateFrameNumbers('player_walk', { - start: 0, - end: 3 - }), - frameRate: 8, - repeat: -1 - }); - } + // Walking animacija je onemogočena za FAZA 2 (fix za canvas texture issue) + // TODO: Dodaj proper sprite sheet animacijo v FAZA 3 } setupControls() { @@ -115,10 +104,7 @@ class Player { const targetScreen = this.iso.toScreen(targetX, targetY); - // Animacija hoje - this.sprite.play('player_walk_anim', true); - - // Tween za smooth gibanje + // Tween za smooth gibanje (brez animacije za zdaj) this.scene.tweens.add({ targets: this.sprite, x: targetScreen.x, @@ -127,8 +113,6 @@ class Player { ease: 'Linear', onComplete: () => { this.isMoving = false; - this.sprite.stop(); - this.sprite.setFrame(0); // Idle frame } });