Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

Need help with making a ladder


alberio12
 Share

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.

Link to comment
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.

Link to comment
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)

Link to comment
Share on other sites

  • 3 weeks later...

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)

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...