christian.tucker Posted December 14, 2014 Share Posted December 14, 2014 I've finally gotten pretty deep into my server development and decided it was time to do some testing, at first I was very upset, because I couldn't find any reason as to why my multiplayer rendering was broken, however after some deep digging and about three hours of suffering I noticed that the client wasn't running when it wasn't focused. This caused the sprite to not be created, and the data that I sent over the Internet to ultimately not be read, so when the server requested an update for the player corresponding to a certain id, the client didn't have it and it broke. Obviously that's a design flaw on it's own that I will be fixing, but for now I need to figure out how to run the client in the background. I've been going through the phaser docs and I'm not seeing this functionality anywhere, but I'm only half way through it. Any pointers? Link to comment Share on other sites More sharing options...
XekeDeath Posted December 14, 2014 Share Posted December 14, 2014 Take a look at the Game class, specifically the focusLoss function.It is there that pauses the game when focus is lost, but there is also the means for you to achieve what you want: this.stage.disableVisibilityChange Link to comment Share on other sites More sharing options...
christian.tucker Posted December 15, 2014 Author Share Posted December 15, 2014 Take a look at the Game class, specifically the focusLoss function.It is there that pauses the game when focus is lost, but there is also the means for you to achieve what you want: this.stage.disableVisibilityChange Using the stage->disableVisibilityChange does not have any effect. The code I'm using: game.state.disableVisibilityChange = true; I've tried it in both the preload/create functions. Link to comment Share on other sites More sharing options...
XekeDeath Posted December 15, 2014 Share Posted December 15, 2014 It is not a state variable, but a stage variable... christian.tucker 1 Link to comment Share on other sites More sharing options...
Recommended Posts