I want to play an animation when someone drags a sprite from it's default position to another selected position. If they drag half of the selected position then animation will be play half. For example, I have 15 frames of a animation for a projectile arm. The projectile arm can be rotated a maximum of 30°, if someone rotates the arm 2° then the animation sprite should show the 2nd frame, if rotated 12° then the animation sprite should show the 6th frame.... and so on. Also when they release the arm, the arm will be reverse back to it's default position and animation frames also will be reverse back to the 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 combine them. Can anyone give me an idea or any tutorial on how to do this?