Need help about Drag a sprite with Animation (Cocos2d)

Posted by Zishan on Game Development See other posts from Game Development or by Zishan
Published on 2012-04-10T14:47:23Z Indexed on 2012/04/10 17:47 UTC
Read the original article Hit count: 322

Filed under:
|

I want to play an animation when someone drag a sprite from it's default position to another selected position. If he drag half of the selected position then animation will be play half. Example, I have 15 Frames of a animation and have a projectile arm. The projectile arm can be rotate maximum 30°, if someone rotate the arm 2° then animation sprite will be show 2nd frame, if rotate 12° then animation sprite will be show 6th frame.... and so on. Also when he release the arm, then the arm will be reverse back to it's default position and animation frames also will be reverse back to it's default first frame.

I am new on cocos2d.I know how to make an animation and how to drag a sprite but I have no idea how to do this. Can anyone Please give me any idea or any tutorial how to do this, it will be very helpful for me. Thank you in advance.

© Game Development or respective owner

Related posts about animation

Related posts about cocos2d-iphone