I would like a fade-in & fade-out for my music. It is designed to fade in if the enemies can see you, and then stop where it was and fade back out if they can't see you anymore. Unfortunately, it's not working. This is how it works: (by the way, I typed this from memory)

Code:

while(player.health > 0{
temp.x = clamp(temp.x, 0, music_volume);
temp.y = clamp(temp.y, 0, music_volume);
if(player.seen == true){
temp.x -= 1;
temp.y += 1;
media_tune(slow, music_volume-temp.x, 0,0);
media_tune(fast, music_volume-temp.y, 0,0);
}
else{
if(player.seen == false){
temp.x += 1;
temp.y -= 1;
media_tune(slow, music_volume-temp.x, 0,0);
media_tune(fast, music_volume-temp.y, 0,0);
}
}
}




this doesn't work either:
Code:
 
temp.x = 0;
while(temp.x < music_volume){
temp.x += 1;
media_tune(music, music_volume-temp.x, 0, 0);
wait(1);
}



however, if I remove the fade, it works!

Code:

while(player.health > 0{
if(player.seen == true){
media_tune(fast, 1, 0,0);
media_tune(slow, music_volume, 0,0);
}
else{
if(player.seen == false){
media_tune(slow, 1, 0,0);
media_tune(fast, music_volume, 0,0);
}
}
}





Last edited by KojaK; 09/20/07 20:01.