feat(effects): extinguish fire with water/rain and ambient SFX volume
Water and rain erase fire under a tight brush hit radius; add looping fire/rain ambients and an Effects sound slider that also scales one-shot effect SFX. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
/** Звук эффекта «Луч света» (`public/luch_sveta.mp3`). */
|
||||
|
||||
import { getEffectsSfxGain } from './effectsSfxGain';
|
||||
|
||||
const SUNBEAM_SFX_VOLUME = 0.88;
|
||||
/** Воспроизведение на 50% быстрее → реальная длительность = файл / 1.5. */
|
||||
export const SUNBEAM_PLAYBACK_RATE = 1.5;
|
||||
@@ -47,7 +49,7 @@ export async function getSunbeamEffectLifeMs(): Promise<number> {
|
||||
export function playSunbeamEffectSound(): void {
|
||||
try {
|
||||
const el = new Audio(sunbeamEffectSoundUrl());
|
||||
el.volume = SUNBEAM_SFX_VOLUME;
|
||||
el.volume = Math.max(0, Math.min(1, SUNBEAM_SFX_VOLUME * getEffectsSfxGain()));
|
||||
el.playbackRate = SUNBEAM_PLAYBACK_RATE;
|
||||
void el.play().catch(() => undefined);
|
||||
} catch {
|
||||
|
||||
Reference in New Issue
Block a user