Try this approach...
Create an array to save the sound references
When a sound is playing you can get a reference to the sound instance, so you can check if it is still playing
When it stops, play the next one
Keep a reference to the current sound playing so you can move it on, loop back to sound 1 etc.
Sample code below, untested. This should play each sound in turn then loop back to the first. The check is done in the main loop, so everything else in your game keeps on moving
//arrays for sounds and instances
public arrSound as integer[6]
//variable for sound instance
public instance as integer
//variable for current sound
public curSound as integer
// Load sounds
for i = 1 to 6
arrSound[i] = loadsound("sound" + str(i) + ".wav")
next i
//Start first sound...
curSound = 1
instance = PlaySound(arrSound(curSound))
do
//check if sound is still playing
if GetSoundInstancePlaying(instance) = 0
inc curSound, 1
if curSound > 6 then curSound = 1
instance = playsound(arrSound(curSound))
endif
//Do all of your other game stuff here in parallel with the sound playing and sequencing
sync()
loop
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt