Calculate trajectory end

kjflukekjfluke Member, PRO Posts: 23
Hi guys. So, I am building a basic cannon game and I am trying to improve on ORBZ sweet trajectory template. The problem I am having is that the "cannon" is movable on both axis and can shoot in any direction. The first problem is that because the plot points are distributed evenly, when aimed straight up or down there are no visible plot points (or one or two). The other problem is in aiming the cannon to the left. What I get is the cannon placed in the middle of a trajectory that runs from edge to edge. I thought that if I can get the plot points to start at the cannon placement and distribute evenly between the cannon and the end point of the trajectory (assuming a straight horizontal landscape) instead of the distributing based on display size, as ORBZ demo does. But to do that, I need to calculate the predicted horizontal distance of the "ball."
I have tried various versions of :
d=((v)^2)*sin(2*(angle))/g
to calculate the predicted horizontal distance. But I am failing. Please help!

Comments

  • kjflukekjfluke Member, PRO Posts: 23
    Never mind. I figured it out. I will post a template if I can figure out where. It turned out pretty slick.
  • ChechesoftChechesoft Member, PRO Posts: 171

    I am with exactly the same problem, I solved the shot any direction part... but the evenly distributed part still evades me... How did you solve it?

Sign In or Register to comment.