Variable Jump Height

How to I make my 2d platformer so when I hold A, the player jumps higher, but a short tap makes the player jump lower?
If you know the game Celeste, or Hollow Knight, this is a feature, and i want to add it to my game, its a usefull mechanic for platformers

3 Likes

You could make it so that each second that the A button is pressed, the characters y-velocity decreases. This means short presses result in less upward speed, but long ones result in more. You would also want to add that on the A button being released, velocity should return to normal!

1 Like

the microsoft/arcade-platformer extension has this functionality built in!

also has a lot of other niceties like “coyote time” and a grace period for jump button presses

2 Likes

can you show me how to do this?

1 Like

If you send the code yeah, did you mean my or richard’s solution?

richards sorry.
i got the arcade-platformer extensions loaded but its really confusing to use.

1 Like