C
Crispywrists
Guest
Hello!
So I'm trying to make it so when my main character bumps into a moving car it plays one of 3 audio files I have made. I got it so the car stops when colliding with the main character and plays the audio but the audio played multiple times, layering infinitely to become a robotic mess of nothingness.
So I checked the internet and came across:
if !audio_is_playing(snd_1) { audio_play_sound(snd_1,1,0) }
which works nicely, but I want it to play a random choice of audio, so I tried:
if !audio_is_playing(snd_1) {audio_play_sound(choose(snd_outtheway1, snd_outtheway2,snd_outtheway3), 0, false); }
But of course it's only checking for snd_1, and not snd_2, or snd_3 - I was wondering if there was a way to add snd_2 & snd_3 to the list of audio files to check whether they're playing or not....or if there is a much better way of coding this.
Many thanks in advance.
So I'm trying to make it so when my main character bumps into a moving car it plays one of 3 audio files I have made. I got it so the car stops when colliding with the main character and plays the audio but the audio played multiple times, layering infinitely to become a robotic mess of nothingness.
So I checked the internet and came across:
if !audio_is_playing(snd_1) { audio_play_sound(snd_1,1,0) }
which works nicely, but I want it to play a random choice of audio, so I tried:
if !audio_is_playing(snd_1) {audio_play_sound(choose(snd_outtheway1, snd_outtheway2,snd_outtheway3), 0, false); }
But of course it's only checking for snd_1, and not snd_2, or snd_3 - I was wondering if there was a way to add snd_2 & snd_3 to the list of audio files to check whether they're playing or not....or if there is a much better way of coding this.
Many thanks in advance.