1
0
forked from noxious/client

Global const for composable

This commit is contained in:
2025-02-06 21:46:51 +01:00
parent 12735756d7
commit db52bcfff3
2 changed files with 8 additions and 3 deletions

View File

@ -1,6 +1,6 @@
export function useGameComposable() {
const activeSounds: { [key: string]: HTMLAudioElement } = {}
const activeSounds: { [key: string]: HTMLAudioElement } = {}
export function useGameComposable() {
const playSound = (sound: string, loop: boolean = false, ignoreIfPlaying: boolean = false) => {
// If sound is already playing and we want to ignore
if (ignoreIfPlaying && activeSounds[sound] && !activeSounds[sound].paused) {