hey everyone! finally close to finishing this project of mine, just needed to fix one last thing - the coyote timing.
in page 3 just above the --jump control, i added a variable called falling_timer which goes up by 1 every frame until you touch the ground, in which it resets to 0. i then made it so that if the timer is less than or equal to 6, then the player can jump.
i thought this would act as coyote timing... but i guess not? am i missing something?
i added a number above the player position to show the falling_timer value in game.
Here's your jump code
if btnp(❎) and player.landed and falling_timer<=6 then player.dy-=player.boost player.landed=false sfx(00) end |
You only jump if the player has landed
you could do
if btnp(X) and (player.landed or falling_timer<=6)
witch would work but not be enough : you can indefinitely jump in the air with this. You need to track if the player has already jumped since last leaving the ground, and only allow jump if it's the 1st time.
that makes sense. shouldnt be too hard to figure that out. thanks a ton!
[Please log in to post a comment]