novi trgovc
This commit is contained in:
@@ -64,6 +64,54 @@ class TextureGenerator {
|
||||
canvas.refresh();
|
||||
}
|
||||
|
||||
static createMerchantSprite(scene, key = 'merchant_texture') {
|
||||
if (scene.textures.exists(key)) return;
|
||||
console.log('🧙♂️ Creating Merchant Sprite Texture...');
|
||||
try {
|
||||
const canvas = scene.textures.createCanvas(key, 32, 32);
|
||||
const ctx = canvas.getContext();
|
||||
ctx.clearRect(0, 0, 32, 32);
|
||||
|
||||
// Body (BRIGHT GOLD robe - zelo viden!)
|
||||
ctx.fillStyle = '#FFD700'; // Gold
|
||||
ctx.fillRect(8, 6, 16, 26);
|
||||
|
||||
// Head
|
||||
ctx.fillStyle = '#FFE4C4'; // Bisque skin
|
||||
ctx.fillRect(10, 4, 12, 12);
|
||||
|
||||
// Hat (Red Merchants Hat)
|
||||
ctx.fillStyle = '#8B0000'; // DarkRed
|
||||
ctx.fillRect(8, 2, 16, 4);
|
||||
ctx.fillRect(10, 0, 12, 2); // Hat Top
|
||||
|
||||
// Backpack (Brown - visible on sides)
|
||||
ctx.fillStyle = '#8B4513';
|
||||
ctx.fillRect(4, 10, 4, 14); // Left side pack
|
||||
ctx.fillRect(24, 10, 4, 14); // Right side pack
|
||||
|
||||
// Straps
|
||||
ctx.fillStyle = '#A0522D';
|
||||
ctx.fillRect(8, 10, 16, 2);
|
||||
|
||||
// Eyes
|
||||
ctx.fillStyle = '#000000';
|
||||
ctx.fillRect(13, 8, 2, 2);
|
||||
ctx.fillRect(17, 8, 2, 2);
|
||||
|
||||
// Beard (White)
|
||||
ctx.fillStyle = '#F5F5F5';
|
||||
ctx.fillRect(10, 12, 12, 4);
|
||||
ctx.fillRect(12, 16, 8, 2);
|
||||
|
||||
canvas.refresh();
|
||||
console.log('✅ Merchant Sprite Created!');
|
||||
}
|
||||
catch (error) {
|
||||
console.error('❌ ERROR creating merchant sprite:', error);
|
||||
}
|
||||
}
|
||||
|
||||
static createCloudSprite(scene, key = 'cloud') {
|
||||
if (scene.textures.exists(key)) return;
|
||||
const canvas = scene.textures.createCanvas(key, 64, 32);
|
||||
@@ -336,6 +384,7 @@ class TextureGenerator {
|
||||
TextureGenerator.createPlayerSprite(this.scene);
|
||||
TextureGenerator.createPlayerWalkSprite(this.scene);
|
||||
TextureGenerator.createNPCSprite(this.scene, 'npc', 'zombie');
|
||||
TextureGenerator.createMerchantSprite(this.scene, 'merchant_texture');
|
||||
|
||||
TextureGenerator.createFlowerSprite(this.scene);
|
||||
TextureGenerator.createBushSprite(this.scene);
|
||||
|
||||
Reference in New Issue
Block a user