How to make a ladder?

This forum is currently in read-only mode.
From the Asset Store
___ Huge collection of 2d fully extensible ladders ____
  • I've been trying, but it never works quite like I want it to.

    Help me, please

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • What have you tried?

    Also, I'm not on my Construct computer right now, but I can work up an example later on when I get to it. If someone doesn't beat me to it.

  • I've tried that when the player is overlapping the ladder and presses up or down, set the gravity to 0, then move the player up or down TimeDelta*200, and restore gravity if left, right, or jump is pressed...

    By the way, I'm using the Platform Behavior.

    When I keep going down the ladder and get to the ground, the player starts sliding to the left.

    Also, if I press up and THEN jump to the ladder, the gravity is set to 0 anyways.

  • Hm not sure if this works but

    GOING UP??

    player overlaps ladder

    +

    key up pressed

    set gravity to 0 (needed I guess?)

    player set y to player.Y - 2 (you can increase/decrease that)

    GOING DOWNNN?

    player overlaps ladder

    +

    key down pressed

    set gravity to 0 (needed I guess?)

    player set y to player.Y + 2 (you can increase/decrease that)

    that's rough and it probably needs more to function right...

  • it may also help to make a condition that is inverted:

    IE.

    player is overplapping ladder (inverted)

    player is pressing up (inverted)

    -restore gravity to whatever you have it set to

    this way, if you do something like jump at the top, the gravity will set itself back to what its meant to be and it wont get stuck being 0.

  • Sorry it took so long, I couldn't use my Construct computer all day yesterday, so I just whipped this up in the last twenty minutes. It seems pretty solid, but I know it could probably be cleaned up a little (especially the centering-on-ladder code, it's a bit redundant having it occur twice). At the very least it should give you an idea of where to go from here.

    http://www.fileshack.us/get_file.php?id ... ladder.cap

    The whole thing's commented, but if you have any questions just ask.

    But yeah, everyone posting suggestions in this thread were pretty much on the right track, except I used Set Speed in the Y direction instead of manually setting the Y position (that could cause problems with clipping into solids).

  • Well, did it work out for you?

  • Warm it up Kr!s

    I'm about to

    Warm it up Kr!s

    That's what I was born to do

  • Thanks a lot!

    I merged your code with mine to achieve exactly what I wanted.

    I'm really happy I got that solved!

    I'm working on a big project and it's nice to have things working perfectly in this early stage to avoid dealing with annoying problems later.

    Thanks, deadeye!

  • Glad it worked out for you. I was going to post annoying stuff in this thread until you came back to check on it

    I guess I'm off the hook now.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)