Kev, awsome stuff. I took a

Kev, awsome stuff. I took a look and decided to have a little go, got everything running ok and then started messing. Obviously, I wanted to do something which is not in the demo, so I tried a joint.....

maybe you can tell me where I`m going wrong as the 2 crates just fall to the floor unconnected.. thanks
:)

Entity b1 = new Crate(700,100,20,10,5);
env.addEntity(b1);
Entity b2 = new Crate(720,100,20,10,5);
env.addEntity(b2);
new FixedJoint(b1.getBody(),b2.getBody());
Vector2f anchor1=(Vector2f)b1.getBody().getPosition();
Vector2f anchor2=(Vector2f)b2.getBody().getPosition();
new DistanceJoint(b1.getBody(),b2.getBody(), anchor1, anchor2,20);

hope to hear from you soon, you never know, you might rekindle my desire to code :)

Kev: The joints need to be added to the physics world.

Reply

*
*
The content of this field is kept private and will not be shown publicly.

*

  • Lines and paragraphs break automatically.
Verify comment authorship
Captcha Image: you will need to recognize the text in it.
*
Please type in the letters/numbers that are shown in the image above.