Tag Info

Hot answers tagged

2

Emanuele Feronato did a tutorial on this some time ago, you can use it as a base: http://www.emanueleferonato.com/2012/03/05/breaking-objects-with-box2d-the-realistic-way/ To sum it up: Listen to collisions between your breakable body and the bodies that can break it; When collision happens, get the velocity of the body that can break the other and ...


2

When centering the camera using lookAt you need to clamp the y value to be the max of the body's y and the y of the ground plus half the viewport height (possibly adjusting for the height of the ground). Something like this might make sense; float x = body.getWorldCenter().x; float y = Math.max(body.getWorldCenter().y, ground.getWorldCenter().y + ...


1

After much frustration, I found out that I had made a folder the same name with the text file by mistake!! After deleting the folder all works fine, thank you for replying!


1

I had this class in previous project public class ExtendedCamera extends OrthographicCamera { public Player player; public ExtendedCamera(Player player) { super(Constants.WORLD_WIDTH, Constants.WORLD_HEIGHT); this.player = player; } public void followPlayer() { if (player.body.getPosition().x - position.x > ...


1

In order to make the title appear with the image you need to use the location of the image plus an offset. The reason (PPlane.WIDTH / 2) - (title.getWidth() / 2) works to center the image is because you're finding the midpoint of the PPlane and then subtracting an offset equal to half of the title's width which has the effect of centering the image ...



Only top voted, non community-wiki answers of a minimum length are eligible