next problem,
i want to stop all sounds, when the player goes to the menu screen.
but i dont know how to manage these.
i tried
Game.StopSound();
and
var sound = Game.IsSoundPlaying();
sound.StopSound();
but didnt work
Hi,
this can't work because IsSoundPlaying() returns only true or false.
Your supposed way would have been (providing you use the Game.CreateEntity)
var sound = Game.CreateEntity(); // proper place where you get the entity pointer
... // Some code here where you play the sound etc.etc.
if (sound.IsSoundPlaying()) // let's test if the sound didn't finish in the meantime
{
sound.StopSound(); // Stop the sound.
}
It's untested but should work.
Edit: I've read it more carefully, so this is only partial answer to your question.
I am dealing with the very same issue using one simple daemon, which stores all sound pointers into an array and then
through a simple loop stops them so you can try something like the following pseudo code
for (var l1 =0; l1<Number_of_Sounds;l1 = l1+1)
{
sound = sound_array[l1];
if (sound.IsSoundPlaying()) // let's test if the sound didn't finish in the meantime
{
sound.StopSound(); // Stop the sound.
}
}
It depends on your sound organization though.
Hope that helps.