Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Kamanashis Biswas
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12125
30
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not a game designer, but my guess is that some of the threads are paused.
 
Stephan van Hulst
Bartender
Pie
Posts: 5812
61
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4404
3
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Jj Hill
Ranch Hand
Posts: 41
Chrome Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic