How to add a sound to a sprite

Posted By: Dennis_W

How to add a sound to a sprite - 03/30/10 14:55

Hi All

Can someone tell me how to add a sound effect to a sprite in wed.

Thanks for your time

Dennis
Posted By: Blink

Re: How to add a sound to a sprite - 04/01/10 00:20

did you look at the manual under media play? there are examples there that will help. its pretty easy.
Posted By: Widi

Re: How to add a sound to a sprite - 04/01/10 04:36

I think in WED you don`t can add a Sound. You have to use Lite-c for that.
Posted By: alibaba

Re: How to add a sound to a sprite - 04/01/10 05:57

you can add sounds via WED but they will loop and you cant move them anymore.
look into the maual for:
snd_play
snd_loop
ent_playsound
ent_playloop

everything is explained in the manual wink
Posted By: Dennis_W

Re: How to add a sound to a sprite - 04/02/10 13:55

Thanks every one I did find in the manual on how to play a sound. I have a sprite that is a explosion and I what to play the sound with it. The problem I am having is that I can get the sound be for or after the sprite. This is what I have now.

action explosion()

{
SOUND* explosion_snd = "explosion.wav";
my.ambient = 100;
my.flags |= BRIGHT;


while(1)
{

while (!key_e) wait (.1);
snd_play (explosion_snd,100,0); wait(1);
for (my.frame=0; my.frame<12;

my.frame += 0.5 * time_step) wait (.01);

}
}
© 2024 lite-C Forums