• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
lowercase baba
Posts: 13089
67
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not a game designer, but my guess is that some of the threads are paused.
 
Saloon Keeper
Posts: 15510
363
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 4716
9
Scala Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 41
Netbeans IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
These are the worst of times and these are the best of times. And this is the best tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic