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

In My Application I Have One Arrow Image With Fix Center and i Can rotate it by touch move method on same center but i also need to Toss/trow the arrow after doing some rotation with dragging or without doing that How Can I Put The Toss/Throw Action in MyApplication

Thank You Very Much In/ advance

share|improve this question
up vote 1 down vote accepted

Not sure about your specific application, but in general it would work like this.

float startPos = /* touchStart */;
float endPos = /* touchEnd */
float angle = atan2f(startpos.y - endpos.y, startpos.x - endpos.x);
float force = 10;

float velocityX = cosf(angle) * force;
float velocityY = sinf(angle) * force;

/** Move object every frame using velocityX / velocityY **/ 
share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.