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

How can I calculate the position of an object after "firing" it from a fixed point?

I am to create a small game - most likely with canvas (pure HTML, JS based) or Adobe Flash - in which the player fires objects at other obstacles in order to clear them.

share|improve this question
up vote 2 down vote accepted

You may want to look at this question and this one.

Assuming you are not using a physics engine/library that will handle the motion for you (and simply call back in to your code when a collision event occurs), you probably want to simulate projectile motion (also here, here, and in general here).

share|improve this answer

Good old physics will help you here. Specifically the equations of motion:

If you want to simulate projectile motion (as in an arc) there's plenty of information for that too:

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.