This commit is contained in:
2026-01-16 02:43:46 +01:00
parent bc2225ad64
commit 3ae8d39f9c
218 changed files with 87850 additions and 353 deletions

View File

@@ -18,12 +18,31 @@ class GameScene extends Phaser.Scene {
this.townRestorationSystem = null;
}
preload() {
// 🎨 STYLE 32 ASSET PIPELINE (SMOOTH 512px)
// Loading the new high-res vector assets
// Load Kai (Style 32 - Smooth)
this.load.image('player_style32', 'assets/sprites/smooth/kai_main.png');
// Load Backgrounds (Style 32 - Noir)
this.load.image('bg_farm', 'assets/sprites/smooth/kai_style32.png'); // Using farm mockup as BG for now
this.load.image('bg_town', 'assets/sprites/smooth/town_style32.png'); // Using town mockup
// Load UI/Zombie Assets (Style 32)
this.load.image('zombie_miner', 'assets/sprites/smooth/mine_style32.png'); // Placeholder till we slice
console.log('✨ Style 32 Smooth Assets Loaded');
}
async create() {
console.log('🎮 GameScene: Initialized!');
// 🖼️ SETUP BACKGROUND (Direct Farm Image)
// Checks 'farm_background' (from Phase 1) or fallback 'intro_chaos'
const bgKey = this.textures.exists('farm_background') ? 'farm_background' : 'intro_chaos';
// Checks 'farm_background' (from Phase 1) or fallback 'bg_farm' (New Style 32)
const bgKey = this.textures.exists('bg_farm') ? 'bg_farm' :
this.textures.exists('farm_background') ? 'farm_background' : 'intro_chaos';
if (this.textures.exists(bgKey)) {
this.add.image(0, 0, bgKey)
.setOrigin(0, 0)

View File

@@ -266,6 +266,83 @@ class VisualEnhancementSystem {
return { overlay: fogOverlay, particles: fogParticles };
}
// ========== NOIR & PSYCHOLOGICAL EFFECTS (AA) ==========
createVignette() {
// Noir Vignette - Dark corners, focus on center
const width = this.scene.cameras.main.width;
const height = this.scene.cameras.main.height;
const vignette = this.scene.add.graphics();
vignette.setScrollFactor(0);
vignette.setDepth(9000); // Very high depth (UI)
const radius = Math.max(width, height) * 0.8;
// Create a texture for the gradient simply because fillRadialGradient acts weird with alpha sometimes,
// but let's try standard Phaser gradient first.
// Actually, for a pure vignette, a black overlay with a distinct "hole" is often better.
vignette.fillGradientStyle(0x000000, 0x000000, 0x000000, 0x000000, 0, 0, 1, 1);
// Fallback: use a simple texture method if gradient fails, but let's stick to a robust approach:
// Use a black rectangle with a 'mask' or a pre-made vignette png?
// Let's use a code-generated texture for performance and strict control.
const canvas = document.createElement('canvas');
canvas.width = width;
canvas.height = height;
const ctx = canvas.getContext('2d');
const grd = ctx.createRadialGradient(width / 2, height / 2, width * 0.2, width / 2, height / 2, width * 0.7);
grd.addColorStop(0, "rgba(0,0,0,0)");
grd.addColorStop(1, "rgba(0,0,0,0.85)"); // Dark noir edges
ctx.fillStyle = grd;
ctx.fillRect(0, 0, width, height);
// Add texture to Phaser
if (this.scene.textures.exists('vignette_texture')) {
this.scene.textures.remove('vignette_texture');
}
this.scene.textures.addCanvas('vignette_texture', canvas);
const sprite = this.scene.add.sprite(width / 2, height / 2, 'vignette_texture');
sprite.setScrollFactor(0);
sprite.setDepth(9000);
sprite.setAlpha(0.9);
this.vignette = sprite;
return sprite;
}
createAmnesiaBlur() {
// "The Awakening" - Full screen blur that slowly clears
// Uses Phaser 3 PostFX
if (!this.scene.cameras.main.postFX) return;
const blur = this.scene.cameras.main.postFX.addBlur(1, 2, 2, 1); // High strength start
// Tween to clear
this.scene.tweens.add({
targets: blur,
strength: 0,
duration: 4000, // 4 seconds awakening
ease: 'Power2',
onComplete: () => {
this.scene.cameras.main.postFX.remove(blur);
}
});
// Also fade in generic brightness
this.scene.cameras.main.setAlpha(0);
this.scene.tweens.add({
targets: this.scene.cameras.main,
alpha: 1,
duration: 2000,
ease: 'Linear'
});
}
// ========== LIGHTING SYSTEM ==========
initLightingSystem() {