With this code here. If I press square, the gun sound will play and if I release square it will play again
when I press square again, which is what I want.
But if while I'm holding square and then press any other button, the wav will play, and then again when I release that button. I need to find a way to stop it from playing when I press/release the other buttons while holding square?
Code: Select all
while ( 1 )
{
sceCtrlReadBufferPositive( &pad, 1 );
if ( pad.Buttons & PSP_CTRL_SQUARE )
{
if( pad.Buttons != lastPad.Buttons )
{
WAV_Play(ourWav);
}
}
lastPad = pad;
}