Jump to content

Cordova animation dropped frame


Stupra Xuuue
 Share

Recommended Posts

Hello, you guys, I am developing chess game based on Phaser Engine, and it runs well and normally on browser simulators. But when I finally used Cordova to deploy it into a native ios app, it encoutered animation dropped frame. It should has been 60fps, but it finally went down to 10 ~ 20fps. I am wondering whether any great guy has encountered the same problem and any suggestion? It's a meteor project and please check out the link to download phaserMeteor, Thank you~

Link to comment
Share on other sites

I've worked with using Phaser and Cordova together to get a few games out now. By no means an expert, but I might have some ideas that could help.

First, here are some quick and easy things you can try:
- When you create your Phaser.Game instance, if you are currently using Phaser.AUTO as the renderer, try explicitly using Phaser.CANVAS or Phaser.WEBGL. I have found that some platforms are better suited for different renderers. Now I test the game on a whole bunch of browsers and devices and use that to determine which renderer to use when I start the game. In general, I've actually found CANVAS to perform better more often, at least for the games I'm working on.

- You can try using the CrossWalk plug-in for Cordova. It's real easy to use; you just import the plug-in and re-build the project. It adds a significant size to your downloadable file, but it ensures that all devices are using the same browser, which may perform better than the stock UIWebView that iOS devices would use. In personal experience, I haven't noticed much difference, but I have read that others have seen a difference.

 

Next are the hard things. It may just be that your code has some slow elements in it. If you are running on a fast computer, you may not notice the problems until you go to a less powerful mobile device.
- Try using the profiling tools available in most web browsers. If you do a Google search for "{browser name here} profiling tools" you should be able to find some tutorials on how to pull them up. These can then help you find what parts of your code are running the slowest, and where you can focus your optimization efforts.

There are a lot of other things that you can do to optimize (use kill()/revive() instead of destroy(), limit your use of masks, etc.) but these random things probably won't be of much use until you know what code is giving you the most trouble.
 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

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