#I need help with wall jumping mechanic
2 messages · Page 1 of 1 (latest)
If I understood that correctly, you can bypass the trick by always facing the same direction and mashing buttons, right?
So you need to make sure that directions were changed inbetween before allowing another walljump...
So you can introduce a boolean which allows wallJumps. To allow wallbangs of alternating direction (left right, left, right) between walls, I would use two variables:
canWallJumpLeft
and
canWallJumpRight
Lets look at the wallbang on the left wall as an example:
Before WallJump, canWallJumpLeft is true, obviously
Right after walljumping you set it to false
Every time you press the right key, you set canWallJumpLeft to true.
I think it also makes sense to set both booleans to true, once you hit the ground for some strange edge cases... If I got it correcly, that should do it