1 decade ago by JackImpact
Hi All,
anyone knows how to control the volumes of the background music and sound effects separately? I would like to put two sliders in the game, one to adjust the background music's volume, the other one is to control the volumes of sound effects.
Any idea how to do this properly? I managed to create two ig.Music instances in the main and add tracks for bg and effects separately. I also use two jquery sliders to control the volumes successfully. The problem is I can't control the loop of track. For the music, I want them to loop. For the sound effects, for most of them, I want them only play once while some will loop. I know that there is a boolean of loop for the ig.Music. But it only control loop of the whole collection, not the individual track. What I want is to control the loop of individual track....Currently my sound effect such as bullet shooting keep looping, how to make it play only once?
Any help will be appriciated.
anyone knows how to control the volumes of the background music and sound effects separately? I would like to put two sliders in the game, one to adjust the background music's volume, the other one is to control the volumes of sound effects.
Any idea how to do this properly? I managed to create two ig.Music instances in the main and add tracks for bg and effects separately. I also use two jquery sliders to control the volumes successfully. The problem is I can't control the loop of track. For the music, I want them to loop. For the sound effects, for most of them, I want them only play once while some will loop. I know that there is a boolean of loop for the ig.Music. But it only control loop of the whole collection, not the individual track. What I want is to control the loop of individual track....Currently my sound effect such as bullet shooting keep looping, how to make it play only once?
Any help will be appriciated.