Re: redfox's bgt questions?
Not quite. As you have it now, it will turn it off again the next time your key-checking runs, which is probably like 5-20ms later.
What you want is more like:
if(key_pressed(KEY_GRAVE)) {
if(wping<=0;
{
speak("wping on!");
p.play_2d("wpingon.ogg",me.x,me.y, me.x,me.y,false");
wping==1;
}
else
{
speak("wping off!");
p.play_2d("wpingoff.ogg",me.x,me.y, me.x,me.y,false);
wping==0;
}
}
There is another error in there that I noticed. I just copied and edited the code in your post, so that error is still in this example. It's in there twice. No matter what you set wping to initially, this will prevent it from changing. I wouldn't have noticed it if I didn't scroll too far when adding the closing brace.
[edit] Ah, Merin beat me to it. It looks like Merin did it the same way I did, though, so the error is still in that version, too.[/edit]
-- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector