This commit is contained in:
2025-12-12 10:17:21 +01:00
parent 84b07bb433
commit a210638002
30 changed files with 3731 additions and 999 deletions

View File

@@ -299,7 +299,8 @@ class SoundManager {
playHarvest() { this.playSFX('harvest'); }
playBuild() { this.playSFX('build'); }
playPickup() { this.playSFX('pickup'); }
playDig() { this.playSFX('dig'); } // Dodano
playDig() { this.playSFX('dig'); }
playUIClick() { this.beepUIClick(); } // UI click sound
playAttack() { this.beepAttack(); }
playHit() { this.beepHit(); }
playFootstep() { this.beepFootstep(); }
@@ -307,6 +308,22 @@ class SoundManager {
playRainSound() { this.startRainNoise(); }
stopRainSound() { this.stopRainNoise(); }
beepUIClick() {
if (!this.scene.sound.context) return;
const ctx = this.scene.sound.context;
const osc = ctx.createOscillator();
const gain = ctx.createGain();
osc.connect(gain);
gain.connect(ctx.destination);
// Quick, pleasant click sound
osc.frequency.value = 800;
osc.type = 'sine';
gain.gain.setValueAtTime(0.08, ctx.currentTime);
gain.gain.exponentialRampToValueAtTime(0.01, ctx.currentTime + 0.05);
osc.start();
osc.stop(ctx.currentTime + 0.05);
}
beepDig() {
if (!this.scene.sound.context) return;
const ctx = this.scene.sound.context;