Box2D and joints


holy shit I made a joint
So one main thing about the game I want to make is to have a crane magnet who just connects to the crate and keeps it that way until you press a key to let go of any crate under your crane. Okay, seems simple.

Except, it isn't.

Not often in a video game do you need to make a joint on colliding. Box2D, the heart of the physic engine of Love2D, is locking itself before, during and after a collision. So, basically, I spend the last hour or so searching for a clean way to joint two colliding objects. In short, making the impossible happen.

A resolve variable! Which will become a resolve attribute for the, hem, lolcrate's class! The idea is, on entering, I cancel the collision, and I say to my code hey, in 2 update loops or so, please connect those two objects together, please!!

Well, found my solution, let's get going, onto the next adventure!

Leave a comment

Log in with itch.io to leave a comment.