New answers tagged c++11
@Richard Byron explained well and gave a well-made sample code. I think it's better to add additional information about the basic math. I leaved out the wall collision. Sorry for bad hand writing an drawing.
Like Pieter mentioned, you can use 1D kinetic equation for height, which in your case will come to: h = p + vt + 0.5at^2 where a is the acceleration due to gravity. You can then use the quadratic equation to solve for t. Once you have t, you can use the kinetic equations again to calculate how far the ball has travelled width ways. This would tell you ...
Top 50 recent answers are included