Introduction
In this tutorial we are going to add some additional functionality to our platformer games in the form of a double jump action for our character. This is a tutorial focused on the actual mechanics and events needed to add a double jump behavior to your character and also some options for tweaking or further controlling the way the double jump works 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 Wall Jumping tutorial here: Platformer Enhancements - Wall Jumping
Tutorial Info
Skill Level: Intermediate
Construct 2 Version used: r114
Can use Free Version: Yes
Plugins used: None
Projects Used: Platform 1 (simple movement)
There are multiple ways that you could implement the double jump behavior. In this tutorial I will cover some of the most common ways it is implemented as well as how you can adjust and tweak it to meet the particular needs of your game. I will also show how to limit double jumping so that you can choose to allow the behavior only when the player has actually jumped vs. when they have fallen off a ledge or platform as I have seen other struggle with detecting whether the character has actually jumped or if they are falling. The events here can be a bit tricky depending on how you approach it and I have seen many folks overthink how to limit the double jump behavior to only work when someone has actually jumped first.
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 tutorial. You can find them here: How to Make a Platform Game and here: Build a Platform Game - A beginners Guide
At the beginning of the tutorial I will break actions down one step at a time for those who are new to Construct 2. As we progress I will start assuming that you know how to navigate the various screens that we have already seen in other steps. I will also mark any actual actions or tasks that you need to do by prefixing them with Action:, this should allow those of you more familiar with the concepts to jump to the actions and skip the explanations.
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. I tend to stick to using these basic samples as they are built into construct 2 and do not require that you create your own sprites or resources and can instead focus simply on implementing the behaviors themselves. 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 do is remove any unnecessary objects, in this case the text box.
Here is the basic layout of the project when you first open it:
To remove the text object, simply click on it in your layout, then hit delete on your keyboard. This will remove the text object and also warn you that you have removed the only instance of it from your game. That is fine, we won't be needing it.