Music in background

Posted By: gumby

Music in background - 05/21/09 19:32

Hi,
I actually have a game pretty much done but have a few questions. What do I type and where do I type it to make a .wav file loop throughout the game?

I tried a few things and got script errors.

Thanks for the help
Posted By: Jaxas

Re: Music in background - 05/21/09 19:37

SOUND* whamm = "whamm.wav";
var whamm_handle;
...
whamm_handle = snd_loop(whamm, 100, 0);

from manual..
Posted By: gumby

Re: Music in background - 05/22/09 16:30

Thanks,
I found that in the manual.
Guess I don't know where to put it. I tried adding it to the main script in lots of different places and I made a separate script and included it.
Nothing's working.

Where does it go?
Posted By: DJBMASTER

Re: Music in background - 05/22/09 16:52

SOUND* whamm = "whamm.wav";
var whamm_handle;

These bits are definitions of the actual Sound file, and a variable which allows you to control the sound (pause, stop etc). These can be defined globally, which means anywhere outside a function/action. Its best to have them at the top of your script, or even in a seperate script if you want.

The last bit,whamm_handle = snd_loop(whamm, 100, 0);, should be called inside a function or action.

© 2024 lite-C Forums