phase 12 koncxana

This commit is contained in:
2025-12-08 14:16:24 +01:00
parent f3d476e843
commit 81a7895c10
11 changed files with 547 additions and 39 deletions

View File

@@ -229,6 +229,17 @@ class TextureGenerator {
ctx.beginPath(); ctx.arc(32, 16, 4, 0, Math.PI * 2); ctx.fill();
}
} else if (name === 'stable') {
// Stable
ctx.fillStyle = '#8B4513'; // Wood
ctx.fillRect(0, 16, 32, 16);
ctx.fillStyle = '#A0522D'; // Roof
ctx.beginPath();
ctx.moveTo(0, 16); ctx.lineTo(16, 0); ctx.lineTo(32, 16);
ctx.fill();
// Door
ctx.fillStyle = '#000';
ctx.fillRect(10, 20, 12, 12);
} else {
// Generic box for others
ctx.fillStyle = '#8B4513';
@@ -629,6 +640,62 @@ class TextureGenerator {
drawBlock(ctx, 10, 8, '#696969');
c.refresh();
}
// 6. BUCKET (Empty)
{
const { c, ctx } = refresh('item_bucket');
// Body
drawBlock(ctx, 12, 14, '#C0C0C0');
drawBlock(ctx, 14, 14, '#C0C0C0');
drawBlock(ctx, 16, 14, '#C0C0C0');
drawBlock(ctx, 11, 12, '#C0C0C0');
drawBlock(ctx, 17, 12, '#C0C0C0');
drawBlock(ctx, 10, 10, '#C0C0C0');
drawBlock(ctx, 18, 10, '#C0C0C0');
// Handle
ctx.fillStyle = '#696969';
ctx.fillRect(10, 6, 12, 2);
c.refresh();
}
// 7. BUCKET_MILK
{
const { c, ctx } = refresh('item_bucket_milk');
// Body (Same as bucket)
drawBlock(ctx, 12, 14, '#C0C0C0');
drawBlock(ctx, 14, 14, '#C0C0C0');
drawBlock(ctx, 16, 14, '#C0C0C0');
drawBlock(ctx, 11, 12, '#C0C0C0');
drawBlock(ctx, 17, 12, '#C0C0C0');
// Milk Content
ctx.fillStyle = '#FFFFFF';
ctx.fillRect(12, 10, 8, 4);
c.refresh();
}
// 8. BUCKET_MILK_GLOWING
{
const { c, ctx } = refresh('item_bucket_milk_glowing');
// Body
drawBlock(ctx, 12, 14, '#C0C0C0');
drawBlock(ctx, 14, 14, '#C0C0C0');
drawBlock(ctx, 16, 14, '#C0C0C0');
drawBlock(ctx, 11, 12, '#C0C0C0');
drawBlock(ctx, 17, 12, '#C0C0C0');
// Glowing Milk Content
ctx.fillStyle = '#00FF00';
ctx.fillRect(12, 10, 8, 4);
c.refresh();
}
}
static createItemSprites(scene) {
@@ -643,7 +710,10 @@ class TextureGenerator {
{ name: 'item_bone', color: '#F5F5DC' }, // Beige
{ name: 'item_scrap', color: '#B87333' }, // Copper/Bronze (kovinski kos)
{ name: 'item_chip', color: '#00CED1' }, // DarkTurquoise (elektronski chip)
{ name: 'artefact_old', color: '#8B4513' } // Ancient Pot (Brown)
{ name: 'artefact_old', color: '#8B4513' }, // Ancient Pot (Brown)
{ name: 'milk', color: '#FFFFFF' }, // White
{ name: 'glowing_milk', color: '#00FF00' }, // Green
{ name: 'animal_feed', color: '#F4A460' } // Sandy Brown (Feed)
];
items.forEach(item => {
const it = typeof item === 'string' ? item : item.name;
@@ -778,6 +848,7 @@ class TextureGenerator {
TextureGenerator.createToolSprites(this.scene);
TextureGenerator.createItemSprites(this.scene);
TextureGenerator.createScooterSprite(this.scene, 'scooter', false);
TextureGenerator.createBoatSprite(this.scene, 'boat');
TextureGenerator.createScooterSprite(this.scene, 'scooter_broken', true);
TextureGenerator.createAnimatedWaterSprite(this.scene);
TextureGenerator.createPathStoneSprite(this.scene, 'path_stone');
@@ -954,6 +1025,34 @@ class TextureGenerator {
canvas.refresh();
}
static createBoatSprite(scene, key = 'boat') {
if (scene.textures.exists(key)) return;
const canvas = scene.textures.createCanvas(key, 48, 24);
const ctx = canvas.getContext();
ctx.clearRect(0, 0, 48, 24);
// Hull (Wood)
ctx.fillStyle = '#8B4513';
ctx.beginPath();
ctx.moveTo(0, 0);
ctx.lineTo(48, 0);
ctx.lineTo(40, 24);
ctx.lineTo(8, 24);
ctx.closePath();
ctx.fill();
// Rim
ctx.strokeStyle = '#603010';
ctx.lineWidth = 2;
ctx.strokeRect(2, 2, 44, 20);
// Seat
ctx.fillStyle = '#603010';
ctx.fillRect(16, 8, 16, 4);
canvas.refresh();
}
static createChickenSprite(scene, key, activeMutation) {
if (scene.textures.exists(key)) return;
const canvas = scene.textures.createCanvas(key, 24, 24);