This position is uncomfortable for most people, as they will naturally be holding the phone at an angle, which will result in a constant non-zero value from one or more of your input axis. The best way to solve this problem is to allow the user to "calibrate" the accelerometer to the natural angle they are holding the phone at.
Do this by providing a "calibration button" perhaps in an options screen. When the button is pressed, record the accelerometer values. Now you can subtract these values from any further accelerometer input to "normalize" it to the new default orientation.
An implementation of this concept can be found in my book, "iPhone Game Development".
What do you need to know to create a game for the iPhone? Even if you've already built some iPhone applications, developing games using iPhone's gestural interface and limited screen layout requires new skills. Loaded with descriptive examples and clear explanations, iPhone Game Development provides everything from game development basics and iPhone programming fundamentals to guidelines for dealing with special graphics and audio needs, creating in-game physics, and much more.




Help







