by Super Pieman » Wed Nov 07, 2007 4:31 pm
I have a sound effect that is supposed to only work when the i key is pressed and only once until the character hits the ground. For some reason it always plays when you hit the i key even in the air. Here are my codes.
on collision with the ground.
- Code: Select all
in_air=0;
on collision finish of the ground.
- Code: Select all
CreateTimer("Jump", 100);
(repeats only once.)
On "Jump" timer.
- Code: Select all
in_air=1;
On keydown for jump key.
- Code: Select all
if(in_air==1)
{
PlaySound2("/data/Mario Jump.wav" 0, 0, 1);
}
If anyone can tell me what is wrong please do.
Current Projects:
*Lonely (2%)
**LinkSys (1%)
*To be made in GE, then ported to DS.
**To be made for the DS.