Saturday, July 1, 2017

physics - Tracking Object Position - Firing on a Trajectory


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.



Answer



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).


No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...