Page 1 of 1

Help please, sound bug! :'(

PostPosted: Sun May 15, 2011 8:40 pm
by Hblade
I'm trying my hardest to find a way around the jump sound effect bug... What happens is, I guess it happens whil ewalking but it'll play 2 sounds when you jump sometimes >.> I tried using stopSound(2) to cancel out the channel before it plays it, but that still remains glitchy as it makes a lag-sound Oo the code for jumping is:
Code: Select all
if (A==1 || KBD_A==1) {
    if (temp[0]==0) {
        temp[0]=1;
        yvelocity=-16;
        PlaySound2("data/smw_jump.wav", 1.000000, 1, 0.000000);
        if (animindex==1) {
            ChangeAnimation("Event Actor", "jumprightsmall", FORWARD);
                          }
        if (animindex==3) {
            ChangeAnimation("Event Actor", "jumpleftsmall", FORWARD);
                          }
                    }
                      }

Explanation of A and KBD_A and other vars:
A, represents Xbox 360 style controls (no bugs in the controls btw), and KBD_A represents the jump key, which is K
the animindex makes so it doesn't loop change the animation (No animation bugs either btw)
temp[0] basically is jump


When I jump it makes it 1 to uh... not loop the jump, however, sometimes the yvelocity fails to activate I noticed, yet it plays the sound O.o... why is this?



Collision with top of land (repeat yes) code:
Code: Select all
temp[0]=0;

Re: Help please, sound bug! :'(

PostPosted: Sun May 15, 2011 10:19 pm
by jimmynewguy
If you're using physical response (I found a while ago) your player animation might have a low point where he goes one pixel downwards/upwards then other animations and he'll get like sorta glitched up in the ground. It happened so my player wouldn't jump though, not a sound error. Try making sure all of your player sprites line up exactly. Other than that I see no reason for a bug :(

Re: Help please, sound bug! :'(

PostPosted: Sun May 15, 2011 10:57 pm
by Hblade
Thanks so much! :D i'll try that