Beyb26 Posted June 30, 2017 Share Posted June 30, 2017 Hi in this states i uploaded my game is so laggy and i notice a bit of stopping after a platform leaves the viewport. It is a simple platformer game, hope you noticed this issue. THanks endlessState.js Link to comment Share on other sites More sharing options...
FlashyGoblin Posted June 30, 2017 Share Posted June 30, 2017 What mode do you have the Phaser renderer in? Canvas or WebGL? Then there is the mode within Cocoon, which is either Canvas+ or WebView. I'm having good results using Phaser Canvas and Canvas+ in Cocoon. Setting screencanvas to true to increase performance in Canvas+ (https://docs.cocoon.io/article/screencanvas/) game.canvas.screencanvas = true Link to comment Share on other sites More sharing options...
Beyb26 Posted June 30, 2017 Author Share Posted June 30, 2017 If that so, i will just put that line of code on my game sir? My mode of rendering is Canvas and Canvas+ on CocoonJs. im having error on that particular line sir. It seems like there's no kind of property of that canvas in the game prototype. my Phaser version is 2.7.10 Link to comment Share on other sites More sharing options...
samme Posted July 1, 2017 Share Posted July 1, 2017 I think Phaser enables screencanvas automatically now. Link to comment Share on other sites More sharing options...
samme Posted July 1, 2017 Share Posted July 1, 2017 @Beyb26 I can see two points for improvement: In the update loop, most or all of those callAll and setAll calls are redundant. You should avoid creating and destroying coins during update and instead recycle from a fixed pool. Link to comment Share on other sites More sharing options...
Beyb26 Posted July 2, 2017 Author Share Posted July 2, 2017 How is that can be Sir @samme ? Do you mean I should create an external function for that particular sequence or maybe there is a built-in method that i can use to achieved that recycling? thanks for your response Sir, really appreciated. Link to comment Share on other sites More sharing options...
samme Posted July 2, 2017 Share Posted July 2, 2017 On 7/1/2017 at 8:57 AM, samme said: You should avoid creating and destroying coins during update and instead recycle from a fixed pool. See https://phaser.io/examples/v2/groups/recycling. Link to comment Share on other sites More sharing options...
Beyb26 Posted July 3, 2017 Author Share Posted July 3, 2017 Thank you Sir. I think I should debug this for now and observe the difference. Thanks for the idea. Link to comment Share on other sites More sharing options...
Recommended Posts