O'Reilly logo

Windows Phone 7 XNA Cookbook by Zheng Yang

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using accelerometer to make a ball move on your phone

Accelerometers, which are useful for game programming, are becoming more common nowadays. An accelerometer is a device, a kind of a sensor, contained in the Windows Phone 7 that can report the device's current axis or orientation. In other words, it can tell if the device is lying on the horizontal plain or rotated to the vertical position. This data from accelerometer presents the Windows Phone 7 game programmers with the opportunity to work with gravity, orientations, and so on. Instead of using the touchscreen, or pressing a button to move objects on the screen, the accelerometer makes it possible for players to shake or adjust the Windows Phone 7 device in whichever direction they want. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required