Dismounting a ladder

0 favourites
  • 3 posts
From the Asset Store
___ Huge collection of 2d fully extensible ladders ____
  • I'm working on my 2d platformer state machine setup and hit another roadblock, this time related to ladders and specifically, how to dismount them.

    I've looked over the examples but they either allow for Y movement on the ladder(I want the character locked to the center of the ladder on Y while climbing) or they require a separate key binding to dismount.

    What I want is to have the player exit the climb state when they reach the ground (I have this working) or when they press left or right when they are within a few pixels of a platform adjacent to the ladder (not yet working).

    I want pressing right arrow to dismount onto the platform to the right.

    <img src="http://i45.tinypic.com/fjiagj.png" border="0" />

    I assume I need to find a way to compare the playerCapsule and Tile's Y position but I'm not having much luck doing it. I'm still unclear on how to have it compare the nearest tile value, or how to set a small range of pixels that will allow the dismount. I suspect the solution lies with allowing the Player to continue to climb when there is Collision with a tile but to dismount when their Y origins line up with an offset.

    The .capx is here:

    dl.dropbox.com/u/1587144/2D_StateTesting_03a.capx

    The climbing "code" are in events 17-22.

    Thanks in advance for any help.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • In your picture your stop sign would be an ideal place for an invisable sprite...this could trigger a dismount animation or allow x axis movement..

  • Aha! That makes sense, especially since I want to add ledge-climbing. I hadn't thought of that. Thanks!

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