Creating Jump-Thru Platforms
Try reloading this page, or reviewing your browser settings
This video shows how to create a springboard object that enables the player character to jump higher.
- Construct 2
- Level Design
- Platform Physics
About this video
- Lee Stemkoski
- First online
- 15 February 2019
- Online ISBN
- Copyright information
- © Lee Stemkoski 2019
Lee Stemkoski: In this video, we’ll add some more objects to our game, but unlike the previous video where we added collectible objects, these objects are permanently parts of the environment, but our character, Jack the Koala, can still interact with them. In particular, we’ll be creating three objects. First, springboards which Jack can jump on top of and will enable him to jump higher. Second, platforms that our character can jump through from below or fall through from above if desired and finally, spikes. Sharp pointy things which damaged the character if he comes into contact with him and caused the character to lose health. And if the characters health goes down to zero, that’s another way in which you could lose the game.
To begin, let’s open up our project from last time. Last time we had added the coin objects, the heart objects, and the clock objects. We’ll start by adding some more sprites. So with your mouse positioned over the layout, right click, choose Insert New Object. Click once on Sprite. We’ll begin by adding the springboard. So we’ll name this sprite Springboard. Click on Insert. We have the cross hairs. First, we’ll place this over here. And the springboard is made up from a Sprite strip animation, so we’ll be using the animation frames window down below. Your mouse is positioned over it. Right click in the pop-up menu. Choose Import frames from sprite strip.
We’re going to choose the file springboard.PNG. This is composed of three images arranged horizontally. We’ll choose Open. Again, Construct guesses that we have three horizontal cells, three going across only one row. We’ll check the box to replace the entire existing animation and click OK. Yes, we are sure. So click OK again. And this is going to be a looping or repeating animation, so I’ll click on the animation name Default. And in the Properties panel to the left, change No to Yes. When we’re done, we can click the x to close this window. And I’ll position this down here on the ground.
Now we’ll add the event which allows the Koala to interact with the springboard. In the Event sheet, we’ll click. Go down towards the bottom. We’ll add an event. The event will be a Koala event. The condition is On collision with another object and click the button to choose the Springboard. Also, we really want this to take effect only if the Koala jumps on top of it from above. So we’ll add a second condition. Right click on this condition. From the menu, choose Add another condition, so it’d be another Koala condition. And underneath the Platform category, we’ll select Is falling. So if you fall on top of this springboard, then the Koala will be propelled into the air.
Let’s add an action. This is a Koala action. We’ll scroll down to the Platform category and to give the Koala a boost upwards, we’re changing its vertical velocity or its velocity in the Y direction. So we’ll choose the action Set vector Y and choose Next. To move the Koala upwards against the force of gravity, we want to enter in a large negative number. So from experience, I know that negative 1000 is probably a good number. You can make it smaller or larger to change the force of the jump. We’ll click on Done and we’re ready to test.
Let’s save, then press the Run layout button. The web browser loads. We’ll walk over to our springboard. Sure enough, our Koala launches high into the air. That’s important to notice that the Koala can walk past to the springboard if desired only by falling on top of it, but it gets launched into the air. Excellent. Let’s close to the preview. Now we’re ready to add our next feature.