This commit is contained in:
2026-01-21 02:25:15 +01:00
parent cf23eef790
commit 8c8d041097
29 changed files with 390 additions and 22 deletions

View File

@@ -4,36 +4,80 @@ export default class GrassScene extends Phaser.Scene {
}
preload() {
console.log("🌱 Loading Clean Assets...");
console.log("👻 Loading Haunted Memory Assets...");
// 1. TERRAIN (From new 'assets/slike/environment' folder)
this.load.image('ground', 'assets/slike/environment/plot_watered.png');
// 1. TERRAIN & CHARACTER
this.load.image('grass', 'assets/slike/environment/grass_tile.png');
this.load.image('kai', 'assets/slike/characters/liki_kai_ref_kai.png');
// 2. UI (From new 'assets/slike/ui' folder)
this.load.image('buy_btn', 'assets/slike/ui/shop_11_buy_button.png');
// 2. GHOSTS (Memory of Parents)
// Path corrected after rename (Ghost: -> Ghost)
this.load.image('ghost_father', 'assets/slike/NOVE_SLIKE/Characters/starsa/Ghost/ghost_otac_cyan.png');
this.load.image('ghost_parents', 'assets/slike/NOVE_SLIKE/Characters/starsa/Ghost/MOJE_SLIKE_KONCNA_ostalo_parents_transparent_ghosts_clean.png');
// 3. UI ELEMENTS (Rusty Industrial Style)
this.load.image('frame_rusty', 'assets/slike/NOVE_SLIKE/UI/okvir_zarjavel.png');
this.load.image('health_gauge', 'assets/slike/NOVE_SLIKE/UI/merilec_zdravja.png');
this.load.image('amnesia_mask', 'assets/slike/NOVE_SLIKE/UI/amnezija_maska.png');
}
create() {
console.log("✅ Scene Created. Placing Clean Assets...");
console.log("💀 Reconstructing Memory...");
const { width, height } = this.cameras.main;
const centerX = width / 2;
const centerY = height / 2;
// A. BACKGROUND (Tiled Ground)
// Using tileSprite to repeat the texture across the screen
this.add.tileSprite(0, 0, width, height, 'ground')
.setOrigin(0, 0)
.setTileScale(4); // Scale up for retro look
// --- LAYER 0: BACKGROUND ---
// Trava (Depth: 0)
const bg = this.add.tileSprite(0, 0, width, height, 'grass').setOrigin(0, 0);
bg.setTint(0x888888);
bg.setDepth(0);
// B. UI ELEMENT (Corner Test)
// Placing button in top-left corner
const btn = this.add.image(100, 100, 'buy_btn');
btn.setScale(2); // Make check visible
// --- LAYER 10: CHARACTERS ---
// Father Ghost (Left) - Depth: 10
const father = this.add.image(centerX - 300, centerY, 'ghost_father');
father.setAlpha(0.4);
father.setScale(0.8);
father.setDepth(10);
// C. LABEL
this.add.text(width / 2, height - 50, 'SOURCE: assets/slike/ (NEW)', {
fontFamily: 'monospace',
fontSize: '24px',
color: '#ffffff',
backgroundColor: '#000000'
}).setOrigin(0.5);
// Parents Ghost (Right) - Depth: 10
const parents = this.add.image(centerX + 300, centerY, 'ghost_parents');
parents.setAlpha(0.4);
parents.setScale(0.8);
parents.setDepth(10);
// Kai (Center) - Depth: 10
const kai = this.add.image(centerX, centerY, 'kai');
kai.setScale(0.8);
kai.setDepth(10);
// --- LAYER 100: UI & EFFECTS ---
// 1. Amnesia Mask (Full Screen Overlay) - Depth: 100
const mask = this.add.image(centerX, centerY, 'amnesia_mask');
mask.setDisplaySize(width, height); // Stretch to cover FULL screen
mask.setAlpha(0.9);
mask.setDepth(100);
// 2. Health Gauge (Top Left, Small) - Depth: 100
const gauge = this.add.image(90, 90, 'health_gauge');
gauge.setDisplaySize(150, 150); // Resize to 150x150 as requested
gauge.setDepth(100);
// 3. Rusty Frame (Bottom Center) - Depth: 100
const frameY = height - 100;
const frame = this.add.image(centerX, frameY, 'frame_rusty');
frame.setDepth(100);
// 4. Dialog Text (Centered on Frame) - Depth: 101 (On top of frame)
this.add.text(centerX, frameY, "Kai... se naju spomniš?", {
fontFamily: 'Courier New, monospace',
fontSize: '28px',
color: '#e0e0e0',
fontStyle: 'bold',
stroke: '#000000',
strokeThickness: 5,
shadow: { offsetX: 2, offsetY: 2, color: '#000', blur: 4, fill: true }
}).setOrigin(0.5).setDepth(101);
}
}