Sign in to follow this  
alberio12

Need help with making a ladder

Recommended Posts

I'm having problems with making a ladder in my 2d platformer game. Is there a way to allow my player to pass through my ladder sprite but still be able to detect collision. For example, my player should be able to walk back and forth through the ladder, but once they hit the up key, they should be able to climb the ladder.

 

I have tried using clearShapes but that seems to remove any collision between player and the ladder even though my player can pass through it. I am using P2 phaser.

Share this post


Link to post
Share on other sites

You need to use your own implementation. You probably need to stop the normal physics, and use tweens while the sprite climbs.

 

Look at this: Ladders?

I've read it before and I got it working in arcade. I know that I need to change my player properties on contact but I don't quite know or what I need to change to my ladder sprites properties to get my wanted functionality.

Share this post


Link to post
Share on other sites

do no such thing... (i mean stopping physics entirely)   just set your ladder as sensor.. it will report the collision but not actually collide..

 

if you are working with tilemaps you could take a completely different approach.. paint ladders on a different layer and just ask "on cursorkey up" if there is a tile on that layer on the current player position.. if so.. climb..  (move up/play climb animation)

 

 http://games.xapient.net/attm/  here (level2) is a live example of 2 different approaches (the chain and the ladder, ropes,etc)

Share this post


Link to post
Share on other sites

I guess I could have been more clear. lol I guess I should have said set velocity to 0, or something like that.

do no such thing... (i mean stopping physics entirely)   just set your ladder as sensor.. it will report the collision but not actually collide..

 

if you are working with tilemaps you could take a completely different approach.. paint ladders on a different layer and just ask "on cursorkey up" if there is a tile on that layer on the current player position.. if so.. climb..  (move up/play climb animation)

 

 http://games.xapient.net/attm/  here (level2) is a live example of 2 different approaches (the chain and the ladder, ropes,etc)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.