Question

I am working on an iOS build of a multi-platform HTML5 game. I am using PhoneGap 3.0.0 and Xcode 4.6.3 and testing on an iPad Mini with iOS 6.1.3.

When the app is suspended during game play, the game runs at 1 fps. The issue does not occur for the menus.

Apple's Instruments tell me that the app after resuming is spending over 90% of the time on a function called copyImageBlockSetPNG of ImageIO.

The game is more intense than a typical web game with large sprite sheets and path finding.

I have made sure that webkitRequestAnimationFrame is no longer called as soon as I get the pause event. I have already tried to release the game textures on suspend and load them back up on resume without success.

My only approach that has worked is to save the game state, reload the page, wait for user input, then load the game in progress back up.

Is there some better way to immediately resume the game without the drop in frame rate?

Was it helpful?

Solution

I found out how to handle this issue.

The sprite sheets needed to be trimmed down. After reducing the texture sizes, the game could resume back to its normal frame rate... after taking its time on resuming.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top