There is no problem with the code. Its only one line which is wrong: wait(1).

The engine frame rate is too fast that you cant notice the fade off. Its actually happening. Suppose ur engine running at 512fps. That means for the fade off (which happens over 100 frames) is being done in 100/512 seconds. Thats way to fast to notice it.

Instead i would suggest u use "seconds" to define your wait between the transition. here is something:

Code:
var volume = 100;

function main()
{
video_mode = 2;
video_screen = 2;
var hMedia = 0;
hMedia = media_loop("battle.mid", NULL, 100);

while (volume > 0)
{
	volume -= 1;
	media_tune(hMedia, volume, 0, 0);
	wait (-0.02);
}


u can play around with "0.02" to any value u want. here 0.02 is the seconds to wait between each 1 volume down.


A7 commercial Team / VC++ 2008 Pro
homepage | twitter | facebook