Returning to the Combat System: Launching

I wanted to increase the speed of the initial launch for the jump. The launch system in my game is set up so that I can specify a launch type and the launch type is described by a math function.

So I played around with some math functions and the function I found fit my needs the best was an arctan function shifted slightly so the rise starts near or a little past 0. However, there was also the issue that this function does not return downwards and going from one type of jump to another results in choppy movement. So I ended up adding a parabola so it was carctan(cx) + c + gravx2 + cx + c where c is some arbitrary constants (not all the same). I had to play around with the constants to get the height I wanted. This allowed me to get a fast jump upwards but a gradual descent downwards. Red is the arctan + parabola and blue is the original launch function (just a parabola).

Note: This arc shows y position over time.



Comments

Popular posts from this blog

First Post

March 17 update

July 16 Update