Monday, 15 August 2011

Open Source Game: Simple Ball Bouncing Game Ver 2

I expanded the simple ball bouncing game a bit. It now has a few more functions:
-added game pause function
-added left/right direction movement, toggle between up/left-right movement with direction button
-starts with 1 ball, get extra ball every 100 points (max 5 balls)
-added device rotation handling
-added top score recording using application preference

A simple video of the game is below:

Also learned some new skills, this is my first project with proper device rotation handling (using empty NIB design as the NIB-less design still have problem with rotation handling), and also my first project with saving data in application preference.

For example: I was following the instructions from chapter 7 of "Beginning iOS 4 application Development" for device rotation handling. But found that if I use "willAnimateSecondHalfOfRotationFromInterfaceOrientation" I keep getting this strange message shown below and the program will stop after running for a while: "Using two-stage rotation animation. To use the smoother single-stage animation, this application must remove two-stage method implementations."

Don't know what the hell is "two-stage rotation animation", but after a few searches on the net, I fixed it by replacing the "willAnimateSecondHalfOfRotationFromInterfaceOrientation" function with "willAnimateRotationToInterfaceOrientation".

The source code available here

1 comment: