Tag Info

New answers tagged

0

First of all you should use a DebugRenderer for testing your Box2D world. Otherwise you will have a hard time figuring out what your world is actually doing: Box2DDebugRenderer debugRenderer = new Box2DDebugRenderer(); //the below code goes at the end of the render method: debugRenderer.render(world, camera.combined); Then another thing that catched my ...


1

It doesn't matter what forces you apply, explicitly or implicitly to the joined bodies, the joints will always attempt to restore the relative position/angle of the joined bodies in accordance with the joint type. There are only three ways I can think of for which a joint will stop functioning: The joint is explicitly destroyed using b2World::DestroyJoint ...


0

Had the same problem with the following code: private void restart() { setScreen(new FooScreen); } Solved it simply by wrapping it in private void restart() { Gdx.app.postRunnable(() -> { setScreen(screen); }); } Hopefully that will help you.


0

Level designer is a full time job. Using an editor is really mandatory if you don't want to lose a lot of time. Most professional games like angry birds probably have teams that develops dedicated custom tools to ease their level designers job. Tiled : If i remember well, with Tiled Editor you can place shapes and manually set properties to them. You ...


0

What you want to do is register collision callbacks for each kind of body. // You have a map from bodies to functions of bodies. Map<BodyData, Function<BodyData> > collisionCallbacks; // Invoke the function associated with that kind of body. collisionCallbacks[firstBodyUserData].Invoke(secondBodyUserData); // An example collision function void ...


1

Your density calculation is correct. Either the weight of the human is too much, or you have got to make the human bigger. In real life your human would have more volume or less mass. Which one to select is entirely up to you. And since this is top-down, you can expect to get the wrong density of the human with that formula. If it was a side view game, it ...


0

Models/geometry are created with arbitrary units; if those units happen to already represent meters, no scaling is needed, only translation is needed. model-space coordinate (no units) * World = world-space coordinate (meters) View-space units are the same as World-space. The View matrix translates and orients the world such that the new origin is the ...



Top 50 recent answers are included