THANKS!!
I’ve read the entire internet and I’m still haven’t figured this out. Can someone here help?
I want Santa to throw a snowball. So I create a snowball object and on each frame I update it’s position by adding the vector to the position to get the new position.
But vectors are always linear. I’m trying to think of some way to use the algebraic function for a parabola to get the ball to travel an arc path – but nothing I try works.
I *could* just do it with a bunch of if statements, like this: (if snowball > starting positition + 10){ reverse y direction; }
But that gives me less of an arc and more of a sharp angle, plus – it’s not very elegant.
If angry birds and Bloons can do it, surely it’s not too hard, right?
UPDATE:
Thanks everyone for your help! I think I understand it a *little* better now. I had more control when I turned off the engine gravity and made gy myself. Here are two solutions that worked really well for me in case anyone has this same issue:
In the second one, playing with the first three variables gives you different sizes and speeds of arc on your ball.
I give you a tip: it’s gravity.
And gravity accelerates an object, meaning it’s changing the velocity of an object.
Vertical velocity is handled by a quadratic function. If you have an initial vertical speed, you can just choose to accelerate the ball downward (y -= gravity strength * time elapsed^2).
If you want to “throw at speed in the direction of “, you have an initial position and an x distance and y distance, which helps you get your x speed and initial y speed.