phase 11 koncano

This commit is contained in:
2025-12-08 14:01:41 +01:00
parent 07f0752d81
commit f3d476e843
21 changed files with 1503 additions and 200 deletions

View File

@@ -192,6 +192,43 @@ class TextureGenerator {
// Details
ctx.fillStyle = '#555555';
ctx.beginPath(); ctx.arc(25, 45, 6, 0, Math.PI * 2); ctx.fill();
} else if (type === 'house' || type === 'house_lv2') {
// --- ISOMETRIC HOUSE ---
const isLv2 = (type === 'house_lv2');
// Walls
const wallColor = isLv2 ? '#A0522D' : '#8B4513'; // Lv2 is lighter/refined
ctx.fillStyle = wallColor;
ctx.fillRect(10, 24, 44, 32);
// Roof (Triangle/Pyramid-ish)
const roofColor = isLv2 ? '#8B0000' : '#4682B4'; // Lv2 Red Roof, Lv1 Blue
ctx.fillStyle = roofColor;
ctx.beginPath();
ctx.moveTo(32, 2); // Top
ctx.lineTo(8, 24); // Left
ctx.lineTo(56, 24); // Right
ctx.fill();
// Door
ctx.fillStyle = '#5C4033'; // Dark Wood
ctx.fillRect(26, 40, 12, 16);
// Windows
ctx.fillStyle = '#87CEEB'; // SkyBlue
ctx.fillRect(14, 34, 8, 8); // Window 1
ctx.fillRect(42, 34, 8, 8); // Window 2
// Lv2 Extras: Chimney or extra floor indicator
if (isLv2) {
ctx.fillStyle = '#555';
ctx.fillRect(40, 10, 6, 12); // Chimney
// Second floor window
ctx.fillStyle = '#87CEEB';
ctx.beginPath(); ctx.arc(32, 16, 4, 0, Math.PI * 2); ctx.fill();
}
} else {
// Generic box for others
ctx.fillStyle = '#8B4513';
@@ -605,7 +642,8 @@ class TextureGenerator {
{ name: 'seeds_corn', color: '#B22222' },// FireBrick seeds
{ name: 'item_bone', color: '#F5F5DC' }, // Beige
{ name: 'item_scrap', color: '#B87333' }, // Copper/Bronze (kovinski kos)
{ name: 'item_chip', color: '#00CED1' } // DarkTurquoise (elektronski chip)
{ name: 'item_chip', color: '#00CED1' }, // DarkTurquoise (elektronski chip)
{ name: 'artefact_old', color: '#8B4513' } // Ancient Pot (Brown)
];
items.forEach(item => {
const it = typeof item === 'string' ? item : item.name;
@@ -754,6 +792,190 @@ class TextureGenerator {
TextureGenerator.createPuddleSprite(this.scene, 'puddle');
TextureGenerator.createFurnaceSprite(this.scene, 'furnace');
TextureGenerator.createMintSprite(this.scene, 'mint');
TextureGenerator.createOwlSprite(this.scene, 'owl');
TextureGenerator.createBatSprite(this.scene, 'bat');
// Mutants
TextureGenerator.createTrollSprite(this.scene, 'troll');
TextureGenerator.createElfSprite(this.scene, 'elf');
// Animals
TextureGenerator.createCowSprite(this.scene, 'cow', false);
TextureGenerator.createCowSprite(this.scene, 'cow_mutant', true);
TextureGenerator.createChickenSprite(this.scene, 'chicken', false);
TextureGenerator.createChickenSprite(this.scene, 'chicken_mutant', true);
}
static createOwlSprite(scene, key = 'owl') {
if (scene.textures.exists(key)) return;
const canvas = scene.textures.createCanvas(key, 32, 32);
const ctx = canvas.getContext();
ctx.clearRect(0, 0, 32, 32);
// Body
ctx.fillStyle = '#8B4513'; // SaddleBrown
ctx.fillRect(8, 8, 16, 20);
// Eyes
ctx.fillStyle = '#FFD700'; // Gold eyes
ctx.beginPath(); ctx.arc(12, 12, 3, 0, Math.PI * 2); ctx.fill();
ctx.beginPath(); ctx.arc(20, 12, 3, 0, Math.PI * 2); ctx.fill();
// Pupils
ctx.fillStyle = '#000';
ctx.beginPath(); ctx.arc(12, 12, 1, 0, Math.PI * 2); ctx.fill();
ctx.beginPath(); ctx.arc(20, 12, 1, 0, Math.PI * 2); ctx.fill();
// Beak
ctx.fillStyle = '#FFA500'; // Orange
ctx.beginPath();
ctx.moveTo(16, 14); ctx.lineTo(14, 18); ctx.lineTo(18, 18);
ctx.fill();
// Wings (folded)
ctx.fillStyle = '#A0522D';
ctx.fillRect(6, 12, 4, 12);
ctx.fillRect(22, 12, 4, 12);
canvas.refresh();
}
static createBatSprite(scene, key = 'bat') {
if (scene.textures.exists(key)) return;
const canvas = scene.textures.createCanvas(key, 32, 32);
const ctx = canvas.getContext();
ctx.clearRect(0, 0, 32, 32);
// Body
ctx.fillStyle = '#222';
ctx.beginPath(); ctx.ellipse(16, 16, 4, 6, 0, 0, Math.PI * 2); ctx.fill();
// Wings
ctx.fillStyle = '#333';
// Left Wing
ctx.beginPath();
ctx.moveTo(12, 16); ctx.lineTo(2, 6); ctx.lineTo(4, 20);
ctx.closePath(); ctx.fill();
// Right Wing
ctx.beginPath();
ctx.moveTo(20, 16); ctx.lineTo(30, 6); ctx.lineTo(28, 20);
ctx.closePath(); ctx.fill();
// Eyes
ctx.fillStyle = '#f00';
ctx.fillRect(15, 14, 1, 1);
ctx.fillRect(17, 14, 1, 1);
canvas.refresh();
}
static createTrollSprite(scene, key) {
if (scene.textures.exists(key)) return;
const canvas = scene.textures.createCanvas(key, 48, 48); // Bigger
const ctx = canvas.getContext();
ctx.clearRect(0, 0, 48, 48);
// Body (Big, Green)
ctx.fillStyle = '#228B22'; // ForestGreen
ctx.fillRect(10, 10, 28, 30);
// Head
ctx.fillStyle = '#105510';
ctx.fillRect(14, 4, 20, 16);
// Eyes (Red)
ctx.fillStyle = '#ff0000';
ctx.fillRect(18, 10, 4, 4);
ctx.fillRect(26, 10, 4, 4);
// Club
ctx.fillStyle = '#5c4033';
ctx.fillRect(36, 12, 8, 24);
canvas.refresh();
}
static createElfSprite(scene, key) {
if (scene.textures.exists(key)) return;
const canvas = scene.textures.createCanvas(key, 32, 48);
const ctx = canvas.getContext();
ctx.clearRect(0, 0, 32, 48);
// Body (Slim, Pale)
ctx.fillStyle = '#98FB98'; // PaleGreen (Mutated Elf)
ctx.fillRect(10, 16, 12, 24);
// Head
ctx.fillStyle = '#E0FFFF'; // LightCyan
ctx.fillRect(10, 4, 12, 12);
// Ears (Pointy)
ctx.fillStyle = '#E0FFFF';
ctx.beginPath(); ctx.moveTo(8, 8); ctx.lineTo(4, 4); ctx.lineTo(10, 12); ctx.fill();
ctx.beginPath(); ctx.moveTo(24, 8); ctx.lineTo(28, 4); ctx.lineTo(22, 12); ctx.fill();
// Eyes (Glowing)
ctx.fillStyle = '#00FFFF';
ctx.fillRect(12, 8, 2, 2);
ctx.fillRect(18, 8, 2, 2);
canvas.refresh();
}
static createCowSprite(scene, key, activeMutation) {
if (scene.textures.exists(key)) return;
const canvas = scene.textures.createCanvas(key, 48, 32);
const ctx = canvas.getContext();
ctx.clearRect(0, 0, 48, 32);
// Body
ctx.fillStyle = activeMutation ? '#9ACD32' : '#FFFFFF'; // YellowGreen or White
ctx.fillRect(8, 10, 32, 16);
// Spots (if normal)
if (!activeMutation) {
ctx.fillStyle = '#000000';
ctx.fillRect(14, 12, 6, 6);
ctx.fillRect(28, 18, 8, 4);
} else {
// Glowing veins
ctx.fillStyle = '#00FF00';
ctx.fillRect(12, 14, 24, 2);
}
// Head
ctx.fillStyle = activeMutation ? '#9ACD32' : '#FFFFFF';
ctx.fillRect(0, 8, 12, 12);
// Legs
ctx.fillStyle = '#000000';
ctx.fillRect(10, 26, 4, 6);
ctx.fillRect(34, 26, 4, 6);
canvas.refresh();
}
static createChickenSprite(scene, key, activeMutation) {
if (scene.textures.exists(key)) return;
const canvas = scene.textures.createCanvas(key, 24, 24);
const ctx = canvas.getContext();
ctx.clearRect(0, 0, 24, 24);
// Body
ctx.fillStyle = activeMutation ? '#ADFF2F' : '#FFFFFF'; // GreenYellow or White
ctx.beginPath(); ctx.arc(12, 14, 8, 0, Math.PI * 2); ctx.fill();
// Head
ctx.beginPath(); ctx.arc(16, 8, 5, 0, Math.PI * 2); ctx.fill();
// Beak
ctx.fillStyle = '#ffaa00';
ctx.beginPath(); ctx.moveTo(20, 8); ctx.lineTo(24, 10); ctx.lineTo(20, 12); ctx.fill();
// Comb
ctx.fillStyle = '#ff0000';
ctx.fillRect(15, 3, 2, 3);
canvas.refresh();
}
static createPathStoneSprite(scene, key = 'path_stone') {