I\'ve got a problem with Box2D
. I\'m making a simple 2D game, with a player shooting to enemies. I read that 1 unity in Box2D is equivalent to 1 meter so i shou
Don't use PPM, i know you might have seen a lot of tutorials using PPM but instead use virtual pixels or potato pixel for camera and box2d. Here read this wonderful article and this answer. For example:
OrthographicCamera camera = new OrthographicCamera(20, 11);
Here 20 is any arbitrary number for WIDTH
and HEIGHT
should be actually WIDTH*Gdx.graphics.getHeight()/Gdx.graphics.getWidth()
.
You don't need to set any zoom level, leave it to default.