I’m doing a platform game and one of the itens make the player can glide when he is falling while the jump button is pressed. First I tried a simple thing: with the item equiped change the maximum falling speed. But it makes the jump more higher too I don’t know why. An important detail I could notice is that it makes the jump more higher just with a low value (near to 200 or less). For my game I wished about 60…
Next I changed the code to make “maximum falling speed” change just when the player is falling to not affect the jump anymore. The result is something like a little extra jump swapping the animations of jumping and falling before he starts to glide. The impression I have is that when the value is changed the character compensates for what was missing in the jump with this new lower value of “Maximum falling speed”. But I may be completely mistaken.
Here an important detail is the longer it takes to hold the jump button, the smaller the second jump will be. If the character falls directly without having made a jump and I hold the jump button this problem does not occur and he glide perfectly.
So, I tried with timer to “separate” the jumping and falling, but the problem persisted. And I tried using another key (not the jump key) to make that glide effect but nothing changed.
I know an alternative would be to change gravity, but the result is not what I want, because gradually the character will fall more faster and I would like it to be a constant speed.
The wiki didn’t help-me to much. It says: “By changing the corresponding values under the “Speed and Gravity” options, we can change how fast our character accelerates, decelerates, moves, falls and jumps. I believe these options are self-explanatory so I don’t think they require much explanation. If you want to slow the character object down, you can decrease these values. If you want to speed the character object up, you can increase these values.”
The strange thing is I could put 10.000 on max. falling speed or 1.000 and the jump still the same. The problem like I said before is just with lower value.
So, I don’t know more how to make it works. Maybe there’s something simple I’m not seeing.