Platformer Enhancements - Wall Jumping

Index

Stats

8,670 visits, 39,287 views

Tools

19. So now we have a bit more "realistic" wall jump behavior. Now I need to give the player a bit more control in the air. As it is now, they have to hit up to wall jump, then move their fingers to the left or right arrows to control their jump. To make this more natural, I am going to change the wall jump to work when they hit left or right (depending on which side the wall is on) instead of using the up arrow. So now they will use Up to jump, then left or right to wall jump once they are in the air. On your event sheet lets change the following:

Delete the Keyboard Up Arrow is Pressed event (right click and choose delete).

20. Add an additional condition to each of our sub events so that if the wall is to their left, we check to see if they are hitting the right arrow, and we do the opposite if the wall is to the right. Add the following:

Keyboard Player Platform has wall to Left

Keyboard Right Arrow is Pressed

Keyboard Player Platform has wall to Right

Keyboard Left Arrow is Pressed

This should give us a much more responsive wall jump. Your event sheet should now look like this:

21. Now go ahead and test the project again. You should notice an improvement in the feel of the wall jump. The requirement to push away from the wall may sound more complicated, but actually feels much more natural in use. It also allows for a much more natural feel for jumping back and forth between walls. At this point, if your layout is setup similar to the example I showed at the beginning of this tutorial, you should be able to get your character to jump back and forth between the walls we created earlier. Next I will show you how to use variables to control how many wall jumps the player can do in a row, which for some games may be a requirement.

A rough example of the path you should be able to take at this point is shown below:

  • 0 Comments

  • Order by
Want to leave a comment? Login or Register an account!