File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Game Development and the fly likes What is happening in the background when we pause a game? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Game Development
Bookmark "What is happening in the background when we pause a game?" Watch "What is happening in the background when we pause a game?" New topic
Author

What is happening in the background when we pause a game?

Kamanashis Biswas
Greenhorn

Joined: Dec 02, 2011
Posts: 8
What is happening in the background when we pause a game??? And how the game resume and starts???

Hi All of You,

Can any of my friend tell me What is happening in the background when we pause a game??? And how the game resume and starts??? in Java prospective .
I want to know the step by step scenario. I face this question in an interview . And I could not answer it properly .

Thanks
Kamanashis Biswas
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11444
    
  16

I'm not a game designer, but my guess is that some of the threads are paused.


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3647
    
  17

Well, what I would do in Java is simply stop some sort of timer that's responsible for updating the scene, and when the screen has to be repainted, it checks whether the game is paused and draws an extra filter or text on top.
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4347
    
    2

depends on what you mean by paused. in age of empires 2 you can move your view around the map, queue the production of men ,give orders to your men etc. in other games you cant


SCJP
Visit my download page
Jj Hill
Ranch Hand

Joined: Jul 25, 2011
Posts: 41

You need to post some code, or at least how your program works. If you're using threads for animation, pause the threads. If you're using timers, stop the timers. For multiple threads/timers, just make an array of them and use a for loop to pause/stop each thread/timer. However, if you are doing calculations for animation outside the thread/timer, the stopping of the thread/timer will not be enough.
 
Don't get me started about those stupid light bulbs.
 
subject: What is happening in the background when we pause a game?