Platformer Enhancements - Wall Jumping

Favourite 169 favourites
Tutorial written by BluePhazeOriginally published on 28th, January 2013 - 17 revisions

Introduction

In this tutorial we are going to add some additional functionality to our platformer games in the form of a wall jump action for our character. This is a tutorial focused on the actual mechanics and events needed to add wall jumping to your character and also some options for tweaking or further controlling the way wall jumps work based on the needs of your particular scenario.

Also, please remember if you find this tutorial helpful, use the Vote button to make it easier for others to find it as well. Thank you and have fun!

You can also find my Double Jump tutorial here: Platformer Enhancements - Double Jump

Tutorial Info

Skill Level: Intermediate
Construct 2 Version used: r114
Can use Free Version: Yes
Plugins used: None
Projects Used: Platform 1 (simple movement)

Note that there are multiple ways that the wall jump can be accomplished and I will show a few examples of the different events that can be used to create the effect so you can see how they behave and hopefully provide you with enough of a base for you to create a wall jump that fits your particular games play style. I will also add some options for enhancing the wall jump behavior as well by adding features to it such as limiting the number of wall jumps, giving the wall jump to the character as a power up and even limiting the amount of time the power up remains active.

Prerequisites

Before beginning this tutorial you should have a basic understanding of the default platform behaviors in Construct 2. You should also have a basic understanding of how to create sprites, layouts, variables, events and actions in Construct 2 and how to use them. You should definitely complete one or both of the basic platforming tutorials first as this will ensure that you have the required baseline knowledge of Construct 2 prior to starting this tutoial. You can find them here: How to Make a Platform Game and here: Build a Platform Game - A beginners Guide

Setup

We will start with base project by using one of the built in sample .capx files included with the download of Construct 2. In this case I will start with the "Platform 1 (simple movement)" example that comes with Construct 2. This tutorial can be completed using the free version of Construct 2 (Using version r114 for my example which can be found here: https://www.scirra.com/construct2/releases/r114 ) once you have Construct 2 installed, from the start page choose the Browse Examples option:


From browse down the list of examples and choose the Platform 1 (simple movement) project.


Once you have the project open, we are now ready to start our work. The first thing we will need to do is make some changes to the layout to make it a better test environment for our wall jumping behavior. To do this we are going to create some simple walls so that we can test various scenarios and tweak our parameters as needed. Feel free to run the project at this point so you can get familiar with what is included by default.

Here is the basic layout of the project when you first open it:


In order to give ourselves some walls to work with we will first use the built in drawing tools to create our own wall sprites.

Comments

2
RangerJim 3,425 rep

Very Nice! This will com in handy for my NEXT project...

Monday, January 28, 2013 at 5:11:29 AM
6
BluePhaze 14.7k rep

@RangerJim Glad to hear it, if you have any particular requests feel free to let me know.

Monday, January 28, 2013 at 5:30:04 AM
3
roboteka 16.3k rep

Thank you, very detailed and well written tutorial.

Tuesday, January 29, 2013 at 7:08:20 AM
1
BluePhaze 14.7k rep

Glad to be of assistance, if you have any thing you feel is missing or any corrections I need to make please feel free to let me know.

Tuesday, January 29, 2013 at 5:40:23 PM
2
Wisher 4,098 rep

Great tutorials! and a little suggestion: there is no need to create the wall sprite manually, you can just change the angle of the existing floor sprite to 90, then Ctrl plus Drag to get your walls.

Wednesday, January 30, 2013 at 11:45:14 AM
2
BluePhaze 14.7k rep

Thanks @Wisher! I figured I couldn't hurt to show how easy it is to make your own simple sprites using the drawing tools. But you're right it may make more sense in another tutorial on using the built in tools.

Wednesday, January 30, 2013 at 2:15:18 PM
1
sman118 7,820 rep

Great tutorial! And thank you for being so thorough with your explanations. I'm sure it was a lot of work, but it is definitely appreciated.

Thursday, January 31, 2013 at 3:12:11 PM
2
BluePhaze 14.7k rep

Thanks for the feedback, I am pretty pleased, over 1200 views in the fews days it has been up. Thanks much and I will definitely work on more tutorials as well.

Thursday, January 31, 2013 at 5:58:41 PM
2
BluePhaze 14.7k rep

I am also now working on a video version of this tutorial and a similar one as well on double jump mechanics. I may update the wall jump tutorial as well with a method to stop the player from using a wall jump if they did not jump first. For example, they walk off a ledge and I want to stop them from using wall jump to stop their fall... If anyone is interested let me know and I will append that piece to this tutorial.

Friday, February 01, 2013 at 9:17:01 PM
4
jojoe 6,485 rep

Thanks for this!

I remember trying the blender game engine for the first time and coming across the wall jumping by mistake.

I had the rule that the player can only jump when touching the tile, expecting that the tiles would always be under the player.

later when I was testing, I mised a ledge, and caught a foothold on the side of the tile, and did my first wall jump.

I thought to myself... "man I wonder if this is how the capcom guy came up with this mechanic for Mega-Man.

About 1 month later I saw Super Meatboy on Kongragate or Armor games.

Thanks for this guide, I was thinking of adding this to my next project, this will make it really easy for me.

Have some Karma

Saturday, February 02, 2013 at 6:03:30 AM
1
BluePhaze 14.7k rep

Thanks a lot @jojoe, glad it was useful!

Saturday, February 02, 2013 at 7:03:34 AM
1
Fyda 2,062 rep

Thanks a ton for making this tutorial; it was a lot of help.

I was wondering: how would one implement wall-clinging? Specifically, grabbing onto the wall and staying stuck to it (but sliding down slowly) until one presses the opposite direction (to let go), presses Down (to slide down faster), or does a wall jump?

Also, let's say the wall is a _moving_ wall (it could be the side of a vehicle, for example)... I get the feeling this would mean temporarily anchoring the player's position to the wall's position (except the sliding may complicate that), but I don't see a way to do that via the event sheet. Maybe I'm missing something?

Sunday, February 03, 2013 at 5:10:54 PM
1
BluePhaze 14.7k rep

I will see if I can work out how that would work, I know there are some others on here who have done similar behaviors before. I would think you would have to do some gravity manipulation at that point, or something similar.

Or just check if they are next to a wall and pushing against it and then change the players falling speed. There is a property on platform objects for falling speed. For the upward you would have to change teh Vector Y but more smoothly and slowly than you do in a jump type situation.

Sunday, February 03, 2013 at 7:30:01 PM
1
BluePhaze 14.7k rep

Woot.... about to hit 2000 views on this tutorial! Thanks all for the feedback etc... my next tutorial on double jumping will be up shortly.

Hint... take out the test for is next to wall, and change the key press back to up arrow and you have double jump...

Monday, February 04, 2013 at 3:21:40 PM
2
jayderyu 15.2k rep

Nice tutorial. There is more in it that requried. As in the "how to make a platform" component. don't remove it, but sometimes the basics aren't so much required :)

However one change you might want to consider is the has ability. Instead of a variable. put the entire wall jump event condition into a sub a subgroup for player controls. When the player has the ability enable the group. After x seconds disable the group.

Tuesday, February 05, 2013 at 7:25:22 PM

Leave a comment

Everyone is welcome to leave their thoughts! Register a new account or login.