Jumping Droid runs 60 frames per second on iPod Touch with AIR 2.6
Keeping the same game code for Android and iOS I have been able to make the game running fast on both platforms!
As I mentioned already in a previous post, despite some hardware and software differences it is easy to detect the platform and enable or disable some game features. Apple's iDevices are lacking Menu button but I didn't want to loose the options menu that pauses game, disables/enables sound or comes back to the main menu. So I placed a droid-looking menu button on the screen instead. Another thing that is different is that there is no option to programmatically force to quit an app on iOS as this could be done by pressing Home button. So Quit button that is available when running game on Android is not added to a stage on iOS and other buttons are repositioned. And one last thing is that in version 1.4.0 of Jumping Droid I decided to use masks for the floors' holes to improve look of the game backgrounds. AIR 2.6 supports GPU acceleration for masks and I was getting very similar performance with and without them. I didn't notice any difference with masks on Samsung Galaxy S as well, but HTC Desire dropped to 29 fps... So I'm leaving Android version without masks for now.
In the version 1.3.0 of the game I added dynamic frame rate so when the game is paused or when the user is in one of the menu screens or the game is working at the background (as it was interrupted by a phone call or the user just switched to different app) then frame rate is set to 10 to conserve battery consumption.
You may wonder what's the best way to detect at runtime on what platform the game is running on? I use Capabilities class:
if (Capabilities.manufacturer.toLowerCase().indexOf("ios") != -1) { //do some iPhone/iPod/iPad specific stuff } else if (Capabilities.manufacturer.toLowerCase().indexOf("android") != -1) { //do some Android specific things }
So as the game is not available (yet?) on the Apple Appstore, you can have a look how it performs on iPod Touch. And check the last minute of the movie to see the level with over 20 enemies.


Comments