0 Favourites

Wall jump?

  • How can I recreate a wall jump?

    I tried using the platform behavior:

    Player.IsByWall[Left]

    Keyboard.OnKeyPressed[Space]

         ->Player.simulate[jump]

    but nothing :(

  • You will also want to make it push you 'off' the wall.

    Perhaps you could consider using physics?

    Anyway, I am not sure how 'is by wall' actually works, but here's an idea if it doesn't turn out.

    Put two invisible objects pinned the player like so.

    Image

    If both of the objects are overlapping the wall, then you know you are touching a near-vertical wall.

    Of course, that's all if the problem lies in 'is by wall'. Send your capx!

  • Thanks sqiddster I managed to figure it out any ways : ) was allot simpler than i though actually.

  • Simulating the jump key doesn't work in mid-air, because obviously pressing shift in mid-air by default doesn't let you jump again. Instead you need to set the vector Y to a negative value, e.g. -500 (if your jump strength is 500).

  • Ashley, Yeah that's what i did. :)

  • Another thing to look at on this from a gameplay perspective is what is the purpose of your wall jump? Basically how do you want them to be able to use it. If you make it too forgiving, it can be used to exploit and bypass large chunks of levels depending on how the level design is setup.

    What I tend to do with mine is to put the following checks in place and then react with not only Vector Y -someNumber, but to also do some calculations on the Vector X as well. This way when they wall jump, it also forces them out away from the wall they are currently on so that they cannot just continue to wall jump straight up the wall. They are forced to have to jump in the opposite direction which forces the wall jump to be used the way I intend it to, in order to jump back and forth between two different walls or objects. So here is how I set it up:

    Condition 1

    On Keyboard Right Arrow Pressed

    Condition 2

    Player Platform has wall to left

    Condition 3

    Player Platform in NOT on Floor (Inverse of on floor)

    Action 1: Player Set Platform Vector Y to -500

    Action 2: Player Set Platform Vector X to 400

    Then I repeat this for the other directional arrow:

    Condition 1

    On Keyboard Left Arrow Pressed

    Condition 2

    Player Platform has wall to right

    Condition 3

    Player Platform in NOT on Floor (Inverse of on floor)

    Action 1: Player Set Platform Vector Y to -500

    Action 2: Player Set Platform Vector X to -400

    Of course adjust your X and Y vectors to meet your specific requirements, but the point of mine is to push them far enough away from the wall they are currently on so that they cannot curve back to the same wall and jump off it again from a higher spot. Effectively keeping them from just jumping straight up the wall as much as they want, because that takes no skill.

    Instead it pushed them up and away from the wall with enough of an angle that if there is another wall nearby they can then jump off of it to come back to the current wall. In effect forcing them to jump from one wall the other and if they are going to continue to go up, they will have to continue to switch walls with each jump. Basically making a zig zag pattern of jumps between the two walls.

    Just food for thought, wall jumps are a great game mechanic, but you have to really be careful in how you make them function or they are easy to exploit and remove the challenge from a game.

  • On a side note, I now have a tutorial up on creating wall jumps and also how to tweak and enhance it for multiple scenarios if you are interested: scirra.com/tutorials/452/platformer-enhancements-wall-jumping

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • On a side note, I now have a tutorial up on creating wall jumps and also how to tweak and enhance it for multiple scenarios if you are interested: scirra.com/tutorials/452/platformer-enhancements-wall-jumping

    I have a question about that, the Set vector Y works well and if I change the value of Y the height varies, but if I change the value of X, the movement on the X axis remains the same. This is the case even if I take absurdly large values like +/-4000000000.

    Any help would be appreciated.

  • mrcollins You need to change the platform max speed and deceleration as well.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
42 3,256
taistelusopuli's avatar
taistelusopuli
Topic
20 6,946
desasteraang's avatar
desasteraang
Unread hot topic
25 4,147
NPherno's avatar
NPherno