feat: Automated Audio System & Royalty-Free Asset Integration (Phase 8 & 9)
- Added footstep_grass.wav, wood_chop.wav, forest_ambient.mp3 - Synchronized rhythm footsteps with walk animation frames - Implemented proximity-based pond music modulation - Updated SoundManager to prioritize high-quality assets
This commit is contained in:
@@ -809,6 +809,7 @@ class GameScene extends Phaser.Scene {
|
||||
console.log('🎵 Initializing Sound Manager...');
|
||||
this.soundManager = new SoundManager(this);
|
||||
this.soundManager.startMusic();
|
||||
this.soundManager.playForestAmbient(); // 🌲 PHASE 9: Start background ambience
|
||||
|
||||
// Initialize Parallax System
|
||||
console.log('🌄 Initializing Parallax System...');
|
||||
@@ -1987,7 +1988,26 @@ class GameScene extends Phaser.Scene {
|
||||
}
|
||||
}
|
||||
|
||||
// Parallax Logic
|
||||
// 🎵 PHASE 8: Pond Proximity Audio Modulation
|
||||
if (this.player && this.lakeSystem && this.soundManager) {
|
||||
const playerPos = this.player.getPosition();
|
||||
let minPondDist = 1000;
|
||||
|
||||
// Find nearest pond
|
||||
this.lakeSystem.lakes.forEach(lake => {
|
||||
if (lake.type === 'pond' || lake.type === 'lake') {
|
||||
const d = Phaser.Math.Distance.Between(playerPos.x, playerPos.y, lake.x, lake.y);
|
||||
if (d < minPondDist) minPondDist = d;
|
||||
}
|
||||
});
|
||||
|
||||
// Map distance to modulation factor (e.g., 0 within 5 tiles, 1 far away)
|
||||
// Or 1 at pond center, 0 far away? User said "malo spremeni, ko sem blizu"
|
||||
// Let's go with 1.0 (max change) at dist=0, and 0.0 (no change) beyond 15 tiles
|
||||
const modFactor = Phaser.Math.Clamp(1 - (minPondDist / 15), 0, 1);
|
||||
this.soundManager.setAmbientModulation(modFactor);
|
||||
}
|
||||
|
||||
if (this.parallaxSystem && this.player) {
|
||||
const playerPos = this.player.getPosition();
|
||||
// 🎨 FLAT 2D (NEW!) - Direct position, no conversion
|
||||
|
||||
Reference in New Issue
Block a user