107 lines
4.4 KiB
JavaScript
107 lines
4.4 KiB
JavaScript
// 🎮 GAME SCENE - MEADOW AWAKENING VERSION (Hytale Style)
|
|
// "3x Blink to Wake Up + Virus Fog + Hytale UI + Emotional Memories"
|
|
// Updated: January 20, 2026
|
|
|
|
import Animal from '../entities/Animal.js';
|
|
import MemoryHeartUI from '../ui/MemoryHeartUI.js';
|
|
|
|
class GameScene extends Phaser.Scene {
|
|
constructor() {
|
|
super({ key: 'GameScene' });
|
|
this.player = null;
|
|
this.cursors = null;
|
|
this.controls = null;
|
|
this.isSprinting = false;
|
|
this.lastMoveTime = 0;
|
|
|
|
// Awakening State
|
|
this.amnesiaMode = false;
|
|
this.blinkCount = 0;
|
|
this.isFullyAwake = false;
|
|
this.virusFog = null;
|
|
|
|
// Animal System
|
|
this.animals = [];
|
|
this.memoryHeartUI = null;
|
|
}
|
|
|
|
preload() {
|
|
// --- VISUAL COMPOSITION TEST ASSETS ---
|
|
|
|
// 1. TERRAIN
|
|
// Dirt (Left side)
|
|
this.load.image('dirt', 'assets/slike/glavna_referenca/Environment/ground/05_Chernobyl_assets_references_tiles_town_path_dirt_dry.png');
|
|
// Grass (Right side)
|
|
this.load.image('grass', 'assets/slike/glavna_referenca/Environment/ground/20_Base_Farm_assets_references_biomes_grassland_crop_plots_plot_empty.png');
|
|
|
|
// 2. NATURE
|
|
// Tree
|
|
this.load.image('tree_oak', 'assets/slike/glavna_referenca/Environment/ground/20_Base_Farm_assets_references_biomes_grassland_trees_oak_summer.png');
|
|
|
|
// 3. STRUCTURES
|
|
// Mine Entrance
|
|
this.load.image('mine_entrance', 'assets/slike/glavna_referenca/Environment/buildings/entrance_patched.png');
|
|
|
|
// 4. UI
|
|
this.load.image('gold_frame', 'assets/slike/glavna_referenca/UI/07_Arctic_Zone_MOJE_SLIKE_KONCNA_ostalo_09_price_panel.png');
|
|
this.load.image('heart_icon', 'assets/slike/items/ui/MOJE_SLIKE_KONCNA_ostalo_vmesnik_ikone_heart_icon_style32.png');
|
|
}
|
|
|
|
create() {
|
|
console.log('🎨 Visual Composition Test Started');
|
|
const { width, height } = this.scale;
|
|
|
|
// Disable camera movement for this static test
|
|
this.cameras.main.setScroll(0, 0);
|
|
this.cameras.main.setZoom(1.0);
|
|
|
|
// --- 1. TERRAIN (Split Screen) ---
|
|
// Left: Dirt
|
|
const dirt = this.add.tileSprite(0, 0, width / 2, height, 'dirt').setOrigin(0, 0);
|
|
|
|
// Right: Grass (with blending transition simulation?)
|
|
// Just place it next to dirt for now
|
|
const grass = this.add.tileSprite(width / 2, 0, width / 2, height, 'grass').setOrigin(0, 0);
|
|
|
|
// --- 2. NATURE (Background) ---
|
|
// Add trees in the "distance" (higher up on screen)
|
|
this.add.image(150, 200, 'tree_oak').setScale(0.8).setDepth(5);
|
|
this.add.image(width - 150, 150, 'tree_oak').setScale(0.8).setDepth(5);
|
|
this.add.image(width / 2, 100, 'tree_oak').setScale(0.6).setDepth(4); // Further back
|
|
|
|
// --- 3. MINE ENTRANCE (Focal Point) ---
|
|
// Place on the right side (Grass area), sticking out as a "Safe Zone"
|
|
// Positioned slightly lower to simulate ground level
|
|
const mine = this.add.image(width * 0.75, height / 2, 'mine_entrance').setScale(1.2).setDepth(10);
|
|
|
|
// Add label
|
|
this.add.text(mine.x, mine.y - 120, "MINE ENTRANCE", { fontSize: '16px', color: '#fff', backgroundColor: '#000' }).setOrigin(0.5);
|
|
|
|
// --- 4. VIRUS FOG (Atmosphere) ---
|
|
// Greenish fog coming from right (City direction)
|
|
// Using a gradient texture would be best, but a rect with ADD blend works for test
|
|
const fog = this.add.rectangle(width, 0, width * 0.6, height, 0x00ff00)
|
|
.setOrigin(1, 0) // Anchor right
|
|
.setAlpha(0.2)
|
|
.setBlendMode(Phaser.BlendModes.ADD)
|
|
.setDepth(20);
|
|
|
|
this.add.text(width - 50, 50, "VIRUS FOG >>>", { fontSize: '16px', color: '#00ff00' }).setOrigin(1, 0).setDepth(21);
|
|
|
|
// --- 5. UI OVERLAY ---
|
|
// Gold Frame (Composition check against green)
|
|
// Place it centrally bottom or as a HUD element
|
|
const frame = this.add.image(width / 2, height - 100, 'gold_frame').setScale(1.0).setDepth(100);
|
|
|
|
// Heart Icon (Corner) - Checking functionality without Kai
|
|
this.add.image(60, 60, 'heart_icon').setScale(2).setDepth(100);
|
|
|
|
// Text instructions
|
|
this.add.text(20, height - 40, "VISUAL COMPOSITION TEST: Dirt | Grass | Nature | Mine | UI", { fontSize: '14px', color: '#fff' }).setDepth(100);
|
|
}
|
|
|
|
update() {
|
|
// No logic needed for visual test
|
|
}
|
|
}
|