Forum Moderators: open

Message Too Old, No Replies

Stop an If statement reapeating itself

         

walker

1:45 pm on Dec 10, 2003 (gmt 0)

10+ Year Member



Hi

The code is as follows basically I want it to run the IF statement ONCE so when it sees that the posions are stoped play sound once!

// Sound when completly stopped
if (dots[i].dx == 0 &&
dots[i].dy == 0 &&
dots[i].dx == dots[i].dy)

{
playSound(2);
}

Any help is really appreciated!

Kind Regards

Walker

Purple Martin

8:53 am on Dec 11, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The code in if statement only gets executed once, so that's not the problem. You need to work out how to stop the sound playing (sorry I don't have my reference books with me).