Detecting a ledge in Box2D

Posted by DormoTheNord on Game Development See other posts from Game Development or by DormoTheNord
Published on 2012-10-01T20:55:48Z Indexed on 2012/10/01 21:52 UTC
Read the original article Hit count: 291

Filed under:
|
|
|

I'm making a 2D platformer with Box2D. The player needs to be able to grab onto a ledge and pull him/herself up.

Right now I have a sensor that extends in every direction from the upper half of the player's body.

The logic seems simple enough: if there are tiles inside the sensor and empty space above them, then it's a ledge and the game should act accordingly. The problem is that I can't figure out how to implement that logic with Box2D.

Anyone have any ideas?

© Game Development or respective owner

Related posts about 2d

Related posts about box2d