So imade the player to double jump when he is on the floor but how to make him double jump from a ladder ?
He only jump once when he is on ladder
Thanks for helping …
So imade the player to double jump when he is on the floor but how to make him double jump from a ladder ?
He only jump once when he is on ladder
Thanks for helping …
You could try to add a variable to store if the player is on ladder or not and check if player is on ladder using the variable and if it jumping then allow jump again then set the variable to 0 so it will not be allowed to jump again unless it on a ladder again
if player is on ladder :: onLadder = 1
if onLadder = 1 and player is jumping :: allow jump again and set onLadder = 0
i tried that but didn’t work … i need the double jump happen when the player leaves the ladder (not when he is on it) to jump (when he is in air)
That’s why try to use a variable to store if the player was on a ladder recently and jumped form there.
However, you may need to make the double jump happen manually, ticking the box to allow double jump may not going to work.
You need to try something like:
I don’t have time to test this right now, but something like this should work. I may going to try and see if I can get it to work later today.
The solution I choose is to check if the player is falling and the space key is pressed then allow jump again.
The down side is, the player can jump in the air even if did not jumped before but falling from a platform, in case you don’t want to allow that, you can just simply count the number of times the player jumped and check if the value is 1 before jumping in the air to make sure it would be the second time the player is jumping.
The benefit is that you can double jump from anywhere, as long you are in the air you can jump once.
Download the example from here (it on the bottom)
gametemplates.itch.io/gdevelop-examples
ddabrahim it’s working … but is there a way to make the player double jump when he just falls of a ledge ?
he only jump once i noticed that … it’s not a big deal but it would be nice if there is a way to do it … thanks btw
I have updated the example you can download it now, it is double jumping now either if you jump or fall and also use a variable to control how many times you want to allow the player to jump. So for example if there would be a bonus item that allow triple jump, you can just increase the value from 2 to 3.
Awesome … i will try it out once i get back home from work and i will tell you what happened . Thank you for your awesome help .
And now i can double jump from anywhere . it’s working as it should now . thank you .