开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜