Jump to content

Minimizing games in Multiplayer


Vivek Agrawal
 Share

Recommended Posts

Hello,

I am making a multiplayer card game in phaser, the game is targeted for web as well as packaged for iOS and android using cocoon.io.

Now my problem is suppose a player minimizes/tabs the game on browser or minimizes the app then it doesnt affects others, since he is just same as not taking actions so he will either fold or check when timed out, but the problem is when he maximizes again, all the animations (tweens) that were pending, like some1 betting or players drawing cards, or chips going to winner, all of them play at once.

I am not sure how to procede from here. Is there a way to let the app execute the tweens to sprites even when minimized. 

Also I want to know how to find out when the exported app minimizes, i tried adding listener to onPause and onResume, it works fine on browsers but doesnt on exported cocoonjs app.

Thanks

Link to comment
Share on other sites

The key is that they don't play while minimised, and there are very good reasons for this, apps minimised shouldn’t suck too many cycles (if any) being the main one, the other main one being that it is pointless as no-one can see them and animations are only for the eye.

The problem you really want to solve is how to restore the current state when the window comes back. This will depend on how you've structured your app.

There have been a fair number of these type of questions over the last couple of months, a search will help.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...