I am having trouble creating a character jump in two phases.
I only have an onButtonDown and an onButtonUp phase to create my jump. I don’t want to use an eventListener.
How do I create the jump?
Making a jump is pretty easy with an eventListener, but in this case, I only have two frames to work with. A timer probably won’t work either, because the amount of time the player holds the jump button might be shorter or longer than the time it takes to jump and fall back down, so I can’t cancel it on the onButtonUp phase.
PS: I have to include both the onButtonDown and onButtonUp phase, neither of them can be empty for it to not throw errors.