How can we move sprite on shaking iphone?
i have a CCsprite object (Helicopter) and it moves on the screen where ever we touch. I want to know how to move helicopter without touch e.g开发者_开发百科 it moves upward if we move the iphone upward..
what is it called and how to do it?
By using the Motion Event API, which provides an abstracted view of the accelerometer and gyroscope (if available):
http://developer.apple.com/library/ios/#documentation/EventHandling/Conceptual/EventHandlingiPhoneOS/MotionEvents/MotionEvents.html
精彩评论