udomacenje zombija in uboj\
This commit is contained in:
@@ -577,27 +577,6 @@ class TextureGenerator {
|
||||
// Left Wall (Broken)
|
||||
ctx.fillStyle = '#555555'; // Dark Grey
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(32, 60);
|
||||
ctx.lineTo(10, 50);
|
||||
ctx.lineTo(10, 40); // Lower than house
|
||||
ctx.lineTo(20, 45); // Jagged
|
||||
ctx.lineTo(25, 38);
|
||||
ctx.lineTo(32, 45);
|
||||
ctx.fill();
|
||||
|
||||
// Right Wall (Broken)
|
||||
ctx.fillStyle = '#777777'; // Light Grey
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(32, 60);
|
||||
ctx.lineTo(54, 50);
|
||||
ctx.lineTo(54, 35);
|
||||
ctx.lineTo(45, 30);
|
||||
ctx.lineTo(40, 35);
|
||||
ctx.lineTo(32, 25); // Exposed interior?
|
||||
ctx.lineTo(32, 60);
|
||||
ctx.fill();
|
||||
|
||||
// Debris piles
|
||||
ctx.fillStyle = '#333333';
|
||||
ctx.beginPath(); // Pile 1
|
||||
ctx.arc(20, 55, 5, 0, Math.PI * 2);
|
||||
@@ -831,4 +810,117 @@ class TextureGenerator {
|
||||
canvas.refresh();
|
||||
}
|
||||
}
|
||||
|
||||
// Generiraj vse ikone za items
|
||||
static createItemSprites(scene) {
|
||||
// 1. AXE
|
||||
this.createToolSprites(scene);
|
||||
|
||||
// 2. PICKAXE
|
||||
if (!scene.textures.exists('item_pickaxe')) {
|
||||
const size = 32;
|
||||
const canvas = scene.textures.createCanvas('item_pickaxe', size, size);
|
||||
const ctx = canvas.getContext();
|
||||
ctx.clearRect(0, 0, size, size);
|
||||
|
||||
// Handle
|
||||
ctx.fillStyle = '#8B4513';
|
||||
ctx.fillRect(14, 12, 4, 18);
|
||||
|
||||
// Head (Pick)
|
||||
ctx.fillStyle = '#C0C0C0'; // Silver
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(16, 12);
|
||||
ctx.quadraticCurveTo(28, 8, 30, 16); // Right curve
|
||||
ctx.lineTo(26, 18); // Sharp point right
|
||||
ctx.lineTo(16, 14); // Center
|
||||
ctx.lineTo(6, 18); // Sharp point left
|
||||
ctx.lineTo(2, 16); // Left curve tip
|
||||
ctx.quadraticCurveTo(4, 8, 16, 12);
|
||||
ctx.fill();
|
||||
|
||||
canvas.refresh();
|
||||
}
|
||||
|
||||
// 3. HOE
|
||||
if (!scene.textures.exists('item_hoe')) {
|
||||
const size = 32;
|
||||
const canvas = scene.textures.createCanvas('item_hoe', size, size);
|
||||
const ctx = canvas.getContext();
|
||||
ctx.clearRect(0, 0, size, size);
|
||||
|
||||
// Handle
|
||||
ctx.fillStyle = '#8B4513';
|
||||
ctx.fillRect(14, 4, 4, 26);
|
||||
|
||||
// Head
|
||||
ctx.fillStyle = '#C0C0C0';
|
||||
ctx.fillRect(6, 4, 12, 4); // Top bar
|
||||
ctx.fillRect(6, 4, 4, 8); // Down blade
|
||||
|
||||
canvas.refresh();
|
||||
}
|
||||
|
||||
// 4. STONE
|
||||
if (!scene.textures.exists('item_stone')) {
|
||||
const size = 32;
|
||||
const canvas = scene.textures.createCanvas('item_stone', size, size);
|
||||
const ctx = canvas.getContext();
|
||||
ctx.clearRect(0, 0, size, size);
|
||||
|
||||
ctx.fillStyle = '#808080'; // Grey
|
||||
ctx.beginPath();
|
||||
ctx.arc(16, 16, 10, 0, Math.PI * 2);
|
||||
ctx.fill();
|
||||
|
||||
// Shading
|
||||
ctx.fillStyle = '#A9A9A9';
|
||||
ctx.beginPath();
|
||||
ctx.arc(12, 12, 4, 0, Math.PI * 2);
|
||||
ctx.fill();
|
||||
|
||||
// Crack
|
||||
ctx.strokeStyle = '#555555';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(16, 16);
|
||||
ctx.lineTo(20, 20);
|
||||
ctx.stroke();
|
||||
|
||||
canvas.refresh();
|
||||
}
|
||||
|
||||
// 5. WOOD
|
||||
if (!scene.textures.exists('item_wood')) {
|
||||
const size = 32;
|
||||
const canvas = scene.textures.createCanvas('item_wood', size, size);
|
||||
const ctx = canvas.getContext();
|
||||
ctx.clearRect(0, 0, size, size);
|
||||
|
||||
// Log
|
||||
ctx.fillStyle = '#8B4513';
|
||||
ctx.fillRect(8, 12, 16, 8);
|
||||
ctx.fillStyle = '#A0522D'; // Lighter finish
|
||||
ctx.fillRect(24, 12, 4, 8); // End cap
|
||||
ctx.fillStyle = '#D2691E'; // Bark details
|
||||
ctx.fillRect(10, 14, 8, 2);
|
||||
|
||||
canvas.refresh();
|
||||
}
|
||||
|
||||
// 6. SEEDS
|
||||
if (!scene.textures.exists('item_seeds')) {
|
||||
const size = 32;
|
||||
const canvas = scene.textures.createCanvas('item_seeds', size, size);
|
||||
const ctx = canvas.getContext();
|
||||
ctx.clearRect(0, 0, size, size);
|
||||
|
||||
ctx.fillStyle = '#DEB887'; // Burlywood
|
||||
// 3 seeds
|
||||
ctx.beginPath(); ctx.arc(12, 16, 3, 0, Math.PI * 2); ctx.fill();
|
||||
ctx.beginPath(); ctx.arc(20, 14, 3, 0, Math.PI * 2); ctx.fill();
|
||||
ctx.beginPath(); ctx.arc(16, 20, 3, 0, Math.PI * 2); ctx.fill();
|
||||
|
||||
canvas.refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user