mesano
This commit is contained in:
@@ -53,13 +53,24 @@ class TextureGenerator {
|
||||
ctx.clearRect(0, 0, 32, 32);
|
||||
|
||||
|
||||
ctx.fillStyle = (type === 'zombie') ? '#556B2F' : '#DEB887'; // OliveDrab or Burlywood
|
||||
ctx.fillRect(8, 6, 16, 26); // Body
|
||||
// Elite Zombie: Red body, glowing pink eyes
|
||||
if (type === 'elite_zombie') {
|
||||
ctx.fillStyle = '#8B0000'; // DarkRed
|
||||
ctx.fillRect(8, 6, 16, 26);
|
||||
|
||||
// Eyes (Red for zombie)
|
||||
ctx.fillStyle = (type === 'zombie') ? '#FF0000' : '#000000';
|
||||
ctx.fillRect(10, 10, 4, 4);
|
||||
ctx.fillRect(20, 10, 4, 4);
|
||||
// Glowing Eyes
|
||||
ctx.fillStyle = '#FF1493'; // Deep Pink (glow)
|
||||
ctx.fillRect(10, 10, 4, 4);
|
||||
ctx.fillRect(20, 10, 4, 4);
|
||||
} else {
|
||||
ctx.fillStyle = (type === 'zombie') ? '#556B2F' : '#DEB887';
|
||||
ctx.fillRect(8, 6, 16, 26);
|
||||
|
||||
// Eyes (Red for zombie)
|
||||
ctx.fillStyle = (type === 'zombie') ? '#FF0000' : '#000000';
|
||||
ctx.fillRect(10, 10, 4, 4);
|
||||
ctx.fillRect(20, 10, 4, 4);
|
||||
}
|
||||
|
||||
canvas.refresh();
|
||||
}
|
||||
@@ -300,6 +311,78 @@ class TextureGenerator {
|
||||
canvas.refresh();
|
||||
}
|
||||
|
||||
static createChestSprite(scene, key = 'chest') {
|
||||
if (scene.textures.exists(key)) return;
|
||||
const canvas = scene.textures.createCanvas(key, 32, 32);
|
||||
const ctx = canvas.getContext();
|
||||
ctx.clearRect(0, 0, 32, 32);
|
||||
|
||||
// Chest body (brown)
|
||||
ctx.fillStyle = '#8B4513'; // SaddleBrown
|
||||
ctx.fillRect(6, 12, 20, 16);
|
||||
|
||||
// Lock (gold)
|
||||
ctx.fillStyle = '#FFD700';
|
||||
ctx.fillRect(14, 18, 4, 6);
|
||||
|
||||
// Lid
|
||||
ctx.fillStyle = '#A0522D';
|
||||
ctx.fillRect(6, 8, 20, 4);
|
||||
|
||||
canvas.refresh();
|
||||
}
|
||||
|
||||
static createSpawnerSprite(scene, key = 'spawner') {
|
||||
if (scene.textures.exists(key)) return;
|
||||
const canvas = scene.textures.createCanvas(key, 32, 32);
|
||||
const ctx = canvas.getContext();
|
||||
ctx.clearRect(0, 0, 32, 32);
|
||||
|
||||
// Dark portal/spawner
|
||||
ctx.fillStyle = '#2F4F4F'; // DarkSlateGray
|
||||
ctx.fillRect(8, 8, 16, 16);
|
||||
|
||||
// Red glow
|
||||
ctx.fillStyle = '#8B0000';
|
||||
ctx.fillRect(10, 10, 12, 12);
|
||||
|
||||
// Center black hole
|
||||
ctx.fillStyle = '#000000';
|
||||
ctx.beginPath();
|
||||
ctx.arc(16, 16, 4, 0, Math.PI * 2);
|
||||
ctx.fill();
|
||||
|
||||
canvas.refresh();
|
||||
}
|
||||
|
||||
static createSignpostSprite(scene, key = 'signpost', text = '→') {
|
||||
if (scene.textures.exists(key)) return;
|
||||
const canvas = scene.textures.createCanvas(key, 32, 32);
|
||||
const ctx = canvas.getContext();
|
||||
ctx.clearRect(0, 0, 32, 32);
|
||||
|
||||
// Wooden post (brown)
|
||||
ctx.fillStyle = '#8B4513';
|
||||
ctx.fillRect(14, 8, 4, 24);
|
||||
|
||||
// Sign board
|
||||
ctx.fillStyle = '#D2691E';
|
||||
ctx.fillRect(6, 10, 20, 12);
|
||||
|
||||
// Border
|
||||
ctx.strokeStyle = '#000';
|
||||
ctx.lineWidth = 1;
|
||||
ctx.strokeRect(6, 10, 20, 12);
|
||||
|
||||
// Text
|
||||
ctx.fillStyle = '#000';
|
||||
ctx.font = 'bold 14px Courier';
|
||||
ctx.textAlign = 'center';
|
||||
ctx.fillText(text, 16, 19);
|
||||
|
||||
canvas.refresh();
|
||||
}
|
||||
|
||||
static createToolSprites(scene) {
|
||||
// Placeholder tool generation
|
||||
if (!scene.textures.exists('item_axe')) {
|
||||
@@ -342,7 +425,9 @@ class TextureGenerator {
|
||||
{ name: 'stone', color: '#808080' }, // Siva
|
||||
{ name: 'seeds', color: '#90EE90' }, // Svetlo zelena
|
||||
{ name: 'wheat', color: '#FFD700' }, // Zlata
|
||||
{ name: 'item_bone', color: '#F5F5DC' } // Beige
|
||||
{ name: 'item_bone', color: '#F5F5DC' }, // Beige
|
||||
{ name: 'item_scrap', color: '#B87333' }, // Copper/Bronze (kovinski kos)
|
||||
{ name: 'item_chip', color: '#00CED1' } // DarkTurquoise (elektronski chip)
|
||||
];
|
||||
items.forEach(item => {
|
||||
const it = typeof item === 'string' ? item : item.name;
|
||||
|
||||
Reference in New Issue
Block a user