I have this ball that when OnClick needs to jump up 150px and down again. It need to do this in the total of 1 sec (1000ms).
I’ve tried a couple of methods. One dividing the time in two, first have going up and other half going down… but its somewhat unstable and not that smooth.
Anyone got a idea?
You want an upside-down parabola that starts at zero and returns to zero at t = 1. The formula is:
To figure out k, substitute (t, y) = (0.5, 150) and solve for k.