alberio12 Posted February 24, 2015 Share Posted February 24, 2015 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 More sharing options...
alberio12 Posted February 25, 2015 Author Share Posted February 25, 2015 bump Link to comment Share on other sites More sharing options...
hollowdoor Posted February 25, 2015 Share Posted February 25, 2015 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? Link to comment Share on other sites More sharing options...
alberio12 Posted February 25, 2015 Author Share Posted February 25, 2015 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 More sharing options...
valueerror Posted February 25, 2015 Share Posted February 25, 2015 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 More sharing options...
hollowdoor Posted March 17, 2015 Share Posted March 17, 2015 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 More sharing options...
Recommended Posts