Thursday, June 23, 2011

Ten Weeks of Learning iPhone Programming


About
This is an effort for myself to learn mobile-app programming. This time  I picked iOS first (iPhone programming, XCODE4, Objective-C). As a result of this effort, I wrote an iPhone game called "HappyBall & MadBall", the theme about this game is to deliver Happiness to others.


The following is a 3-minute presentation of mine for an iPhone programming class ended in June, 2011. It was a very intensive programming experience given that I haven't done major C programming for a while and didn't even know about Objective-C to begin with, yet another video project going on at the same time.. For 10 weeks of efforts to be presented in 3 minutes, it was insane.. I worked on the video till the last minute - it took me 6 hours for concepting, laying out story lines, film shooting, editing and eventually finished right before presentation - didn't even got time to review second time. It was done under a great time pressure, however, it was fun. The video has been refined again for some details after the presentation.






The App - "HappyBall & MadBall"
Here are some screen shots (these are only part of the game; the app needs to be run on device to enable camera view). The pictures below were captured from iOS simulator.) I will write more details about the App later; perhaps after I make it to Apple store... 

This App is about real-time image processing for a simple ball game that delivers "Happy Energy" from one ball to another, with real-time obstacles derived from objects in reality.
The App uses "tap-bar view controller" (an iOS term) to switch between to views. The second view in this case is for 'Settings' - where the users can turn on/off camera and choose to enable "Object Vision" feature or not. The object vision is a term I created so people can get the idea easier. It is about image processing to perform edge detection for images. People use terms "Virtual Reality", "Augmented Reality"..etc for similar ideas. This one maybe is, "Reality in Virtual".  


These are the two main characters in the game I created:


HappyBall - the one you will give touches to keep its energy up. It will bounce in the view and react to gravity (i.e. iPhone's accelerometer).  Every time HappyBall hits MadBall, it delivers a point ("Happy Energy") to MadBall. Because it share its happy energy with others, its own  energy drops, i.e. touch count decreases a little bit. And only your touches will boost it up!




This is MadBall. It would be very mad at the beginning until HappBall forwards "Happy Energy". After some points it receives enough energy from HappyBall, it will start changing colors and eventually turn into Happy Color (at points level = 10, 20, 30,50) !


In short, the aim for this game is one game that simple enough for anyl lever of users to pick up easily. Studies show that most people spend time on "simple games" on their mobile devices. (take a look at the top iphone/ipad apps here). For this app, I also aimed for children's games - where I hope they can be just like HappyBall - delivers Happiness to others around them !It was satisfying to see my daughter got the idea right away at first time she played it. She ended up coming back to me saying "I won!" with excitements after 10 minutes getting the Madball turned happy. During the design process, she actually advised me not to lower the HappyBall energy - that makes her sad and she wanted the HappyBall to be happy all the time!



This is a map of the Happy Energy delivery cycle:



Summary:
My idea of learning iPhone programming was to be able to have mobile devices to interact with other hardware devices ("myPAC" - as described at the end of the video clip). I think this project gave me a good jump-start and also helped me pick up a few ideas along the way. iPhone programming actually isn't as easy as it seems - I would say a good iPhone programmer will take years to build up key skills and knowing the tricks. Its no different from any other engineering type of work. However, things here are more tangible and one would enjoy a lot of fun during the process. The challenging side of this is it's about presentations and a lot of them there may be copyright involved -images, sound effects..etc. A multi-talent programmer can make things a lot easier.   The mechanism to deliver an App from an idea to a product on market seems to be pretty organized. For this, I haven't tried yet, Maybe that's something I will try out soon, to send my app to App Store and get a picture how it is like.