Re: Cuing sounds in bgt
Are you using the sound pool, or sound objects?
There are several ways, depending on how your code is arranged.
I'd probably do something like give the enemy/player/etc either a handle to their currently-playing sound, or the number of the slot in the sound_pool, then check when it's done playing like so:
if(handle.playing==false)
or
if(pool.sound_is_playing(slot)==false)
For the sound_pool, you'd need to make the sound persistent, then destroy it when it's done playing.
If you want to queue arbitrary sounds without doing state-based things for each case (for example, if you want to have the music play different tracks, rather than loop the same BGM), you'd probably want to use an array.
Something like:
if(handle.playing==false and queue.length()>0)
{
handle.load(queue[0]);
handle.play();
queue.remove_at(0);
}
HTH
_______________________________________________ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector