enhance(drop-and-fusion): tweak sounds

This commit is contained in:
syuilo 2024-01-12 17:34:24 +09:00
parent b920435068
commit c2a9a7b69e
5 changed files with 29 additions and 10 deletions

View file

@ -1085,16 +1085,35 @@ function attachGameEvents() {
game.addListener('sfx', (type, params) => { game.addListener('sfx', (type, params) => {
if (props.mute) return; if (props.mute) return;
const soundUrl = if (type === 'fusion') {
type === 'fusion' ? '/client-assets/drop-and-fusion/bubble2.mp3' : if (props.gameMode === 'yen') {
type === 'collision' ? '/client-assets/drop-and-fusion/poi1.mp3' : sound.playUrl('/client-assets/drop-and-fusion/fusion_yen.mp3', {
null as never; volume: 0.3 * params.volume * sfxVolume.value,
pan: params.pan,
sound.playUrl(soundUrl, { playbackRate: (params.pitch / 4) * replayPlaybackRate.value,
});
} else {
sound.playUrl('/client-assets/drop-and-fusion/fusion.mp3', {
volume: params.volume * sfxVolume.value, volume: params.volume * sfxVolume.value,
pan: params.pan, pan: params.pan,
playbackRate: params.pitch * replayPlaybackRate.value, playbackRate: params.pitch * replayPlaybackRate.value,
}); });
}
} else if (type === 'collision') {
if (props.gameMode === 'yen') {
sound.playUrl('/client-assets/drop-and-fusion/collision_yen.mp3', {
volume: params.volume * sfxVolume.value,
pan: params.pan,
playbackRate: params.pitch * replayPlaybackRate.value,
});
} else {
sound.playUrl('/client-assets/drop-and-fusion/collision.mp3', {
volume: params.volume * sfxVolume.value,
pan: params.pan,
playbackRate: params.pitch * replayPlaybackRate.value,
});
}
}
}); });
} }