Jump to content
  • Advertisement
Sign in to follow this  

Wall climbing box2d

This topic is 2588 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I used distance joint for the wall climbing but getting very unusual behavior.
I am attaching a screen shot showing the case.

Its the yellow box and the blue wall that shows the distance joint been formed and its unusual behavior.

I first used the b2ContactListener to detect the whether the moving ball makes contact with the left wall.

If there is a touch between the two, then i initialize a distance joint like:

b2DistanceJointDef* dist_joint = new b2DistanceJointDef();
dist_joint->Initialize(movingbox->GetBody(), left->GetBody(), movingbox->GetBody()->GetWorldCenter(), left->GetBody()->GetWorldCenter());
dist_jt = world.GetWorld()->CreateJoint(dist_joint);

Is this logic right???

I want that after the distance joint is formed, i can manipulate the yellow box with key strokes to move up and down showing as wall climbing.

All suggestions are welcome

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!