Sawyer
Member
Hello everyone,
I am creating a little game, in this game your score can increase or decrease.
I am trying to play some song in function of your score.
For exemple you start at score = 0
decrease the gain of the old music (this is only is your score decrease or at the start)
play the new sound but slowly increase his gain
If score = 300
decrease the gain of the old music
play the new sound but slowly increase his gain
if score = 100
decrease the gain of the old music
play the new sound but slowly increase his gain
So i tried many things, but everytime i have the same problem, the transition between my old and new music dont works
Can you help me?
I am creating a little game, in this game your score can increase or decrease.
I am trying to play some song in function of your score.
For exemple you start at score = 0
decrease the gain of the old music (this is only is your score decrease or at the start)
play the new sound but slowly increase his gain
If score = 300
decrease the gain of the old music
play the new sound but slowly increase his gain
if score = 100
decrease the gain of the old music
play the new sound but slowly increase his gain
So i tried many things, but everytime i have the same problem, the transition between my old and new music dont works
GML:
if (score_ < 200){
if play_next = false {//this is to first descrease the gain of the played musci
audio_sound_gain(name_sound_played, 0, 2000);}//descrease the gain of the played music
if audio_sound_get_gain(name_sound_played) = 0 && play_next = false {
audio_stop_sound(name_sound_played);//stop the sound played
play_next = true;}
if (play_next = true && !audio_is_playing(name_sound_played)){
name_sound_played = audio_play_sound(snd_1,1,true);//play the music i want if score <200
audio_sound_gain(name_sound_played, 0, 0)
audio_sound_gain(name_sound_played, 1, 3000)}}//This is to slowly increase the gain
if (score_ >= 200 && score_ < 500){}