popraven novi npc
This commit is contained in:
@@ -866,6 +866,15 @@ class TextureGenerator {
|
||||
TextureGenerator.createOwlSprite(this.scene, 'owl');
|
||||
TextureGenerator.createBatSprite(this.scene, 'bat');
|
||||
|
||||
// Structures (Fix checkered pattern bug)
|
||||
TextureGenerator.createChestSprite(this.scene, 'chest');
|
||||
TextureGenerator.createSpawnerSprite(this.scene, 'spawner');
|
||||
TextureGenerator.createStructureSprite(this.scene, 'ruin', 'ruin');
|
||||
TextureGenerator.createStructureSprite(this.scene, 'arena', 'ruin');
|
||||
TextureGenerator.createSignpostSprite(this.scene, 'signpost_city', '→');
|
||||
TextureGenerator.createSignpostSprite(this.scene, 'signpost_farm', '←');
|
||||
TextureGenerator.createSignpostSprite(this.scene, 'signpost_both', '⇅');
|
||||
|
||||
// Mutants
|
||||
TextureGenerator.createTrollSprite(this.scene, 'troll');
|
||||
TextureGenerator.createElfSprite(this.scene, 'elf');
|
||||
@@ -875,6 +884,9 @@ class TextureGenerator {
|
||||
TextureGenerator.createCowSprite(this.scene, 'cow_mutant', true);
|
||||
TextureGenerator.createChickenSprite(this.scene, 'chicken', false);
|
||||
TextureGenerator.createChickenSprite(this.scene, 'chicken_mutant', true);
|
||||
|
||||
// Villager
|
||||
TextureGenerator.createVillagerSprite(this.scene, 'villager');
|
||||
}
|
||||
|
||||
static createOwlSprite(scene, key = 'owl') {
|
||||
@@ -1404,6 +1416,37 @@ class TextureGenerator {
|
||||
graphics.generateTexture(key, 32, 32);
|
||||
}
|
||||
|
||||
static createVillagerSprite(scene, key = 'villager') {
|
||||
if (scene.textures.exists(key)) return;
|
||||
const graphics = scene.make.graphics({ x: 0, y: 0, add: false });
|
||||
|
||||
// Farmer/Villager - simple human sprite
|
||||
// Head (skin tone)
|
||||
graphics.fillStyle(0xffdbac, 1);
|
||||
graphics.fillCircle(16, 8, 4);
|
||||
|
||||
// Body (blue shirt)
|
||||
graphics.fillStyle(0x4477bb, 1);
|
||||
graphics.fillRect(12, 12, 8, 10);
|
||||
|
||||
// Arms
|
||||
graphics.fillStyle(0xffdbac, 1);
|
||||
graphics.fillRect(10, 14, 2, 6); // Left arm
|
||||
graphics.fillRect(20, 14, 2, 6); // Right arm
|
||||
|
||||
// Pants (brown)
|
||||
graphics.fillStyle(0x654321, 1);
|
||||
graphics.fillRect(12, 22, 8, 8);
|
||||
|
||||
// Eyes
|
||||
graphics.fillStyle(0x000000, 1);
|
||||
graphics.fillRect(14, 7, 1, 1); // Left eye
|
||||
graphics.fillRect(17, 7, 1, 1); // Right eye
|
||||
|
||||
graphics.generateTexture(key, 32, 32);
|
||||
graphics.destroy();
|
||||
}
|
||||
|
||||
constructor(scene) {
|
||||
this.scene = scene;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user