Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.