question

Blitz3D Forums/Blitz3D Beginners Area/question

ngi(Posted 2004) [#1]
I am making a program , and I want it to play a random sound each time an image collides with another image .I have 8 different sound, but I don't know how to do it. Any help please?


WolRon(Posted 2004) [#2]
Create an array that will be used hold the handle to each sound
Dim Sound(8)
then load each sound into one of the array elements
For iter = 1 to 8
  Sound(iter) = LoadSound("sound" + iter + ".ogg") ;sound1.ogg, sound2.ogg, etc.
Next
then when you want a sound to play, use a Random statement to select one of the sounds
PlaySound(Sound(Rand(1, 8)))



ngi(Posted 2004) [#3]
great thx man