Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Playing sound makes game freeze?

Author
Message
AJ Schaeffer
14
Years of Service
User Offline
Joined: 22nd Aug 2009
Location: Jacksonville,FL
Posted: 4th Dec 2011 05:35
Here's my code:


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

What's the best way to do this?

Impetus73
12
Years of Service
User Offline
Joined: 28th Aug 2011
Location: Volda, Norway
Posted: 4th Dec 2011 11:11 Edited at: 4th Dec 2011 11:12
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.



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

Also, remove the , behind 25 in the playsound.

----------------
AGK user - novice
Did Amiga / AMOS programming in the 90's, just started programming again with AGK.
AJ Schaeffer
14
Years of Service
User Offline
Joined: 22nd Aug 2009
Location: Jacksonville,FL
Posted: 4th Dec 2011 17:47
When this happens, a problem I've had before
http://www.youtube.com/watch?v=qZl3gJW45ws

Login to post a reply

Server time is: 2024-05-04 10:59:07
Your offset time is: 2024-05-04 10:59:07