I want to wait a moment (.5 seconds) before I increase the sound, how can i achieve this without using Thread.sleep, because i want my game to keep runnig.
Tell me more
×
Game Development Stack Exchange is a question and answer site for
professional and independent game developers. It's 100% free, no registration required.
|
|
You can either use a java timer approach: http://developer.android.com/reference/java/util/Timer.html Or you could simply keep track of the time elapsed since the increase volume action began. Maybe something like this in your render method or somewhere else:
Of course you need to set volumeIncreasing to true and actionBeginTime=System.nanoTime() somewhere when the action begins. |
|||||
|