novi trgovc
This commit is contained in:
@@ -6,6 +6,7 @@ class NPC {
|
||||
this.gridX = gridX;
|
||||
this.gridY = gridY;
|
||||
this.type = type;
|
||||
console.log(`🎭 NPC Constructor called - Type: ${type} at (${gridX}, ${gridY})`);
|
||||
|
||||
// Terrain offset
|
||||
this.offsetX = offsetX;
|
||||
@@ -119,8 +120,14 @@ class NPC {
|
||||
isAnimated = true;
|
||||
} else if (this.type === 'zombie' && this.scene.textures.exists('zombie_sprite')) {
|
||||
texKey = 'zombie_sprite';
|
||||
} else if (this.type === 'merchant' && this.scene.textures.exists('merchant_sprite')) {
|
||||
texKey = 'merchant_sprite';
|
||||
} else if (this.type === 'merchant') {
|
||||
// Uporabi generirano sliko, če obstaja
|
||||
if (this.scene.textures.exists('merchant_new')) {
|
||||
texKey = 'merchant_new';
|
||||
} else {
|
||||
texKey = 'merchant_texture'; // Fallback na proceduralno
|
||||
}
|
||||
console.log('🏪 Creating MERCHANT NPC with texture:', texKey);
|
||||
} else if (!this.scene.textures.exists(texKey)) {
|
||||
TextureGenerator.createNPCSprite(this.scene, texKey, this.type);
|
||||
}
|
||||
@@ -137,7 +144,9 @@ class NPC {
|
||||
if (isAnimated) {
|
||||
this.sprite.setScale(1.5);
|
||||
} else {
|
||||
this.sprite.setScale(0.3);
|
||||
// Merchant manjši, ostali večji
|
||||
const scale = (this.type === 'merchant') ? 0.2 : 0.5;
|
||||
this.sprite.setScale(scale);
|
||||
}
|
||||
|
||||
// HEALTH BAR
|
||||
|
||||
Reference in New Issue
Block a user