Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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
add comment

2 Answers

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
add comment

Good old physics will help you here. Specifically the equations of motion: http://en.wikipedia.org/wiki/Equations_of_motion

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

http://www.ajdesigner.com/phpprojectilemotion/vertical_velocity_equation.php

http://hyperphysics.phy-astr.gsu.edu/hbase/traj.html

http://library.thinkquest.org/28388/Mechanics/Motions/Projectile.htm

share|improve this answer
add comment

Your Answer

 
discard

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.