posodobitev
This commit is contained in:
@@ -105,8 +105,11 @@ class NPC {
|
||||
}
|
||||
}
|
||||
|
||||
// Check for animated sprites first
|
||||
if (this.type === 'zombie' && this.scene.textures.exists('zombie_walk')) {
|
||||
// Check for NEW isometric sprites first (zombie_worker)
|
||||
if (this.type === 'zombie' && this.scene.textures.exists('zombie_worker')) {
|
||||
texKey = 'zombie_worker'; // NEW: Isometric zombie sprite
|
||||
isAnimated = false;
|
||||
} else if (this.type === 'zombie' && this.scene.textures.exists('zombie_walk')) {
|
||||
texKey = 'zombie_walk';
|
||||
isAnimated = true;
|
||||
} else if (this.type === 'zombie' && this.scene.textures.exists('zombie_sprite')) {
|
||||
@@ -141,13 +144,16 @@ class NPC {
|
||||
this.sprite.setOrigin(0.5, 1);
|
||||
|
||||
if (isAnimated) {
|
||||
this.sprite.setScale(1.5);
|
||||
this.sprite.setScale(2.5); // MUCH larger (zombie worker)
|
||||
} else {
|
||||
// Scale po tipu
|
||||
let scale = 0.5; // Default
|
||||
let scale = 0.3; // Default smaller
|
||||
|
||||
// New NPCs - smaller scale
|
||||
if (this.type === 'cow') scale = 0.2;
|
||||
// NEW: Isometric sprites (MUCH larger!)
|
||||
if (texKey === 'zombie_worker') scale = 2.5;
|
||||
else if (texKey === 'player_dreadlocks') scale = 2.5;
|
||||
// New NPCs - SMALL scale
|
||||
else if (this.type === 'cow') scale = 0.2;
|
||||
else if (this.type === 'chicken') scale = 0.2;
|
||||
else if (this.type === 'troll') scale = 0.2;
|
||||
else if (this.type === 'elf') scale = 0.2;
|
||||
@@ -188,9 +194,15 @@ class NPC {
|
||||
|
||||
const targetScreen = this.iso.toScreen(targetX, targetY);
|
||||
|
||||
// Animation
|
||||
if (this.sprite.texture.key === 'zombie_walk') {
|
||||
this.sprite.play('zombie_walk_anim', true);
|
||||
// Animation - SAFE CHECK
|
||||
if (this.sprite.texture.key === 'zombie_worker') {
|
||||
if (this.scene.anims.exists('zombie_worker_walk')) {
|
||||
this.sprite.play('zombie_worker_walk', true);
|
||||
}
|
||||
} else if (this.sprite.texture.key === 'zombie_walk') {
|
||||
if (this.scene.anims.exists('zombie_walk_anim')) {
|
||||
this.sprite.play('zombie_walk_anim', true);
|
||||
}
|
||||
}
|
||||
|
||||
// Tween za smooth gibanje
|
||||
@@ -205,7 +217,10 @@ class NPC {
|
||||
this.updatePosition();
|
||||
|
||||
// Stop Animation
|
||||
if (this.sprite.texture.key === 'zombie_walk') {
|
||||
if (this.sprite.texture.key === 'zombie_worker') {
|
||||
this.sprite.stop();
|
||||
this.sprite.setFrame(0);
|
||||
} else if (this.sprite.texture.key === 'zombie_walk') {
|
||||
this.sprite.stop();
|
||||
this.sprite.setFrame(0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user