Posted: 4th Dec 2011 5:35
Here's my code:
+ Code Snippet
while GetVirtualButtonState( 1 ) = 1
if GetSoundsPlaying( 1 ) = 0 then PlaySound( 1, 25, )
endwhile


When the button is pressed it plays the sound...and then freezes the game.

What's the best way to do this?
Posted: 4th Dec 2011 11:11
In this case, as long as the button is pressed, the while loop just goes around and around, and no other part of your game will be run, therefore it seems like all froze.

+ Code Snippet
if GetVirtualButtonState( 1 ) = 1 and GetSoundsPlaying( 1 ) = 0 then PlaySound( 1, 25 )


This will check it once every loop instead. It's called "nonblocking logic"

Also, remove the , behind 25 in the playsound.
Posted: 4th Dec 2011 17:47
When this happens, a problem I've had before
http://www.youtube.com/watch?v=qZl3gJW45ws