I followed this tutorial for climbing ladders:
https://www.scirra.com/tutorials/591/a- ... latformers
I'm trying to get the player to climb a ladder by pressing the up key on the keyboard
Here is what I did :
when player is overlapping ladder
the up key is pressed
set the player Y to player.y-c
---> set player platform gravity to 1500
no matter the value of "c" the climbing speed is always the same
It should be as simple as changing c. Maybe you missed something.
https://www.dropbox.com/s/bp2i7y0g7ie87 ... .capx?dl=0
Develop games in your browser. Powerful, performant & highly capable.
Thank you for the reply, I'm pretty sure I'm missing something but I can't find the mistake
here I use two speeds 1 and 5 on your example it work perfectly but on mine it doesn't
https://www.dropbox.com/s/8a2ulvjh7033p ... .capx?dl=0
Two problems (unique to going slow, my first example actually didn't work completely right either, it was just hidden by going fast).
1. You didn't turn off using default controls. Jump overrides the move up one pixel event (you jump first, and then move up), so you pick up all the momentum from your jump when climbing the ladder, which is way faster than what you want. With simulate controls, you can put the jump event AFTER the move up one pixel event - you move up one pixel first, and are no longer on the floor, so you can no longer trigger the jump.
2. Having two ladder events using else - the second else runs even if your first one doesn't, setting gravity back to 1500 thus overriding the first set gravity to 0. Moving one pixel at a time is not fast enough to fight against that gravity (moving 50 was).
Thank you so much !!! I was aware of the second problem, but the first problem was the issue.
Thank you again for explaining it with details and thank you for your time