Battle Shock

Check out Luna Sea Games to see the iPhone version of Battle Shock in the AppStore now.

Sunday, November 28, 2010

digging in

The port of my iPhone game to Android is going well. Game play is up. Some minor bugs. Sound is up. Still needs to accept volume tweaks. Io still coming off the sdcard. That is temporary and needs fixing but shouldn't be too hard. I decided to tackle the application life cycle.

Every time you hit the home button or generally leave your app you get an onPause event. You are expected to do everything needed to wrap up. Here, I discovered, I need to pause the MediaPlayer. It appears that a feature of the player is that it continues playing while in the background. Useful if I was writing a Pandora clone, but not for this game. Next I save the game state to the sdcard. So far this has been quick enough that I haven't run into the problems that some have hit.

http://zakattacktaylor.com/?tag=ndk Has some interesting insights into porting code to the ndk. It was good to learn that Android expects you to reload all your graphics back into memory after being paused. That's my project for tonight.

For anyone looking to know more about the application life cycle I recommend reading:
http://developer.android.com/reference/android/app/Activity.html

No comments:

Post a Comment