Tutorial Downloads

File Size
ladder_platform_tutorial.capx7KB

Stats

2,125 visitors
18.2K page views
826 translation visitors
4.4K translation page views

Simple Ladder for Platformer Game

Favourite 67 favourites
Tutorial written by siksOriginally published on 6th, May 2013 - 3 revisions

Hi everyone!
I've been looking for a ladder tutorial but never found. So I decided to make one myself!

Also, I'll make a translation for PT-BR later.

1) Getting Started

First things first, make a simple level with Solid behavior and a player. Make it so your player can't jump on those platforms above.


I won't explain how to make a simple platformer, but you can find great tutorials on the subject.

2) Player behaviors

Give your player a Platform and 8 direction behaviors. Simply put, we'll activate one and deactivate the other when on ladders and vice versa when not on ladders. Quite simple right?


Check the bold stuff! Those are important!

Directions: Up & Down
Set angle: No
Default Controls: Yes

I'll leave the rest on default, that's really up to you and your game.

BUT! If we leave it like this, it could get pretty buggy, so let's turn that 8 direction behavior off on the start of the layout:


It is important that you "ignore user input" instead of "set disabled".


Also, make sure you don't use the Default Controls on the Platform behavior.

Test it out, but you should be fine!

Don't forget to save! The real stuff starts here!!!

3) Ladder implementation

Let's make a new sprite object called "ladder". Make it thinner than the player.


Now let's start to implement it's functions!

Let's start by giving the player two instance variables: canClimbLadders and onLadders.


Every tick, the game will check the player's status to see if he CAN climb a ladder, setting canClimbLadders to true or false, because maybe in your game there will be some state that you won't want him to be able to climb ladders, like attacking or being hit, I don't know. In our case here, it will always be true.

The variable onLadders will simlpy tell us if the player is climbing a ladder or not.

Okay so let's make our player climb this ladder.


Test it and you can see it's working... kinda. The player only goes up when you press the Up Arrow button and it's pretty glitchy. The secret is in the first Else block.

Let's tune it up!


Okay, now we changed the condition to get out of the ladder by pressing S. We also make the player "snap" to the center of the ladder with the Set X condition. The Platformer vector conditions are there to take care of some bugs, you can find yourself if you haven't already by now.

Also, comments and SAVE IT !

By now you may have noticed that you can't raelly go up the ladder, so what's the point?
That's another simple task:


Geez, but now we can't really get off the stairs - unless we press S - but we should be able to get off the stairs when hitting the floor above or below right?


Notice that I changed the Set Platform Vector X and Set Platform Vector Y placements for optimization.

We are almost ready now! Let's just make the player climb the stairs from above it:


And - with some adjustments - we are finished :)

4) Conclusion

Hopefully the comments make reading the code and understand the logic easier.

This is my first tutorial so please try to bear with me. xD

Leave any questions (or any feedback really) in the comment section below and I'll try to answer it!

Oh and the .capx is there so be sure to download it. :)

See ya!

Unlock your full gamedev potential

Upgrade to the Personal Edition of Construct 2, it has way more features and won't holding back from making money and using your full creativity like the free edition does. It's a one off payment and all Construct 2 editor updates are free for life!

View deals

Plus, it's got a lot of additional features that will help you save time and make more impressive games!

Congratulations on finishing this tutorial!

Did you learn a lot from it? Share it now with your friends!

Share and Copy this Tutorial

You are free to copy, distribute, transmit and adapt this work with correct attribution. Click for more info.

Comments

1
Lordshiva1948 41.9k rep

Nice one very good thanks for sharing

Monday, May 06, 2013 at 10:46:20 AM
1
morex 4,759 rep

hi, can you try downloading the .capx if it work for you?
seems like the .capx is corrupted and it doesn't open at all.

Tuesday, May 07, 2013 at 2:59:51 AM
2
Tedg 9,889 rep

Nice. Thanks for sharing.

Tuesday, May 07, 2013 at 9:00:25 PM
2
ADenton 3,185 rep

Really clear and helpful, not only ladder solution, but your explanation of the logic. Very useful, thanks

Thursday, May 09, 2013 at 1:25:05 PM
2
AbelaNET 14.8k rep

Thanks. Well done.

Thursday, May 09, 2013 at 8:50:43 PM
2
siks 9,405 rep

@morex Just tested and it is working fine here... Try again, maybe it'll work now.

Saturday, May 11, 2013 at 1:15:56 AM
1
mineet 7,086 rep

very informative thank you

Thursday, May 16, 2013 at 10:18:45 PM
2
markpouncey 3,953 rep

Hey-- great tut !!! i was just thinking the same thing about 2 days ago-- no ladder tuts && what good is a platform without some ladders !!! Great job and thanks :) .

Sunday, May 19, 2013 at 1:46:52 PM
1
SoggyBrain 1,522 rep

Very helpful... Thanks!

Wednesday, July 31, 2013 at 9:43:18 AM
2
codefiend 1,284 rep

Hey nice tutorial. Could you re-link that capx file. Unless I'm blind as a bat I cannot find it anywhere on this page. That would be awesome! Thanks

Clint,

Friday, September 13, 2013 at 10:34:16 PM
2
vladutzuli 942 rep

I clicked on the tutorial expecting it to be helpful, and guess what? It really was! Thanks for these extremely useful and well-written instructions, newbies like me are grateful ^^

Tuesday, September 17, 2013 at 5:48:35 AM
1
cbri 1,021 rep

This tutorial is great. I'm very new to construct2 and this helped me learn a lot. One problem I'm having though is my guy won't descend the ladder only climb it. I've checked the code to make sure it's exact and I can't find what's wrong. Which part is the descend block? Thanks!

Friday, September 20, 2013 at 6:20:37 PM
0
smsanthosh 2,455 rep

yup.. thanks for sharing .. more useful.. keep sharing..

Thursday, December 19, 2013 at 8:04:59 AM
0
Joannak 2,560 rep

Excellent tutorial.. I find that there is a slight issue that may become a problem. I'll send PM of it.

Sunday, January 12, 2014 at 7:41:23 AM
0
AndreasR 29.7k rep

nice tutorial ;) but can you make one with touch controll? So if the player overlaps the ladder a button spwan (sprite) and if I pressing that button the player will climb, else he falls from the ladder. I didn't get this working

Tuesday, February 18, 2014 at 4:56:15 PM

Leave a comment

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