Page 1 of 1

Sound Effects

PostPosted: Tue Nov 06, 2007 1:39 am
by Super Pieman
I have a sound effect for when Mario jumps, but the sound effect can be triggered whenever the jump buttun is pressed, even in the air. How do I make it so the jump sound only plays when mario actually jumps?

Re: Sound Effects

PostPosted: Tue Nov 06, 2007 1:45 am
by Game A Gogo
create a variable named "in_air"
on collision with ground:
Code: Select all
in_air=0;

on collision finish of ground:
Code: Select all
createtimer("Jump", 100);//make it only repeat one time

on timer "Jump" :
Code: Select all
in_air=1;

on keydown of your jumping key:
Code: Select all
if(in_air==1)
{
    playsound2("/data/Mario_jump.wav" 0, 0, 1);
}

Not sure if the playsound is correct

Re: Sound Effects

PostPosted: Tue Nov 06, 2007 2:04 am
by Super Pieman
what do you mean by
on timer "Jump"

Re: Sound Effects

PostPosted: Tue Nov 06, 2007 11:22 am
by Bee-Ant
Go to TimerEvent>ScriptEditor
:D

Re: Sound Effects

PostPosted: Thu Nov 08, 2007 12:49 am
by Game A Gogo
click Add=>Timer=>Jump=>Add=>Script