This is my More Complicated Than It Needs To Be Jumping Engine. Click the up arrow or the space button to jump. This is very glitchy. Explanation of My Code ↓ I like these arrows a lot ↓ The jump variable starts at a certain value (corresponding to the jump height ) and gradually lowers itself. As long as you are holding down the arrow button, the player will change y position by jump, meaning it goes up, then down. With only the jump variable, you could stop holding down the button midair and you would just stay there, creating an infinite version of a double jump. This is why I used gravity. The gravity variable matches the jump variable until you stop holding down the up arrow. After you stop, it proceeds to keep lowering it's value, causing the player to reach the bottom. The jump height is just there to change how high you jump.
Credit to @griffpatch for the gravity variable idea. You can use it if you want, I just made it to procrastinate lol.