Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

9 years ago by FragDoctor

Been trying to find a solution to this but failed so far.

There's a point in my game where I'd like to stop all of the sounds currently being played immediately. Then after that I'd like to play a new sound.

I can't just mute the volume because that would prevent the new sound from being heard. I'd basically like to stop everything playing and then pretty much start afresh by playing a new sound.

Is that possible? If it is then I'd appreciate any pointers as I'm currently struggling to find a solution.

9 years ago by Joncom

You use sound.play(); to play a sound, and you can you sound.stop(); to stop playing the sound.

Therefore, to stop all currently playing sounds, you would probably need to keep track of which ones you called play() on, so that you can loop over each one and call stop().
Page 1 of 1
« first « previous next › last »