this might be an option
public static void pauze(){
while(!isContinue()){
//keep the duration small, so the game will be resumed shortly after
// the user presses resume
sleep(500);
}
}
public static boolean isContinue(){
boolean returnVal = false;
// this method checks in the rest of your code, whether or not your user pressed resume
//returnVal = ....
return returnVal;
}
stultuske
Posting Sensei
3,137 posts since Jan 2007
Reputation Points: 1,114
Solved Threads: 433
How about the wait() method?
The API doc says: Causes the current thread to wait until ...
NormR1
Posting Expert
6,677 posts since Jun 2010
Reputation Points: 1,138
Solved Threads: 656
or you could also try ...
Thread.sleep(2 years);
letSHopeTheOriginalPosterStillReadsAndNeeds(this);
if you have a new angle, or a good approach to solve a problem, create a new thread, don't revive threads that haven't been posted in for two years
stultuske
Posting Sensei
3,137 posts since Jan 2007
Reputation Points: 1,114
Solved Threads: 433
To it will better
You thinks that is a better way? Looping and checking is a waste of CPU. will be difficult to implement
What about your code being complicated and difficult.
NormR1
Posting Expert
6,677 posts since Jun 2010
Reputation Points: 1,138
Solved Threads: 656