Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- BodyDef bodyDef = new BodyDef();
- bodyDef.linearDamping = 1f;
- MapLayers mapLayers = screen.getTiledMap().getLayers();
- MapLayer mapLayerPlayer = mapLayers.get("player_position");
- bodyDef.type = BodyDef.BodyType.DynamicBody;
- player2body = world.createBody(bodyDef);
- FixtureDef fixtureDef = new FixtureDef();
- PolygonShape shape = new PolygonShape();
- Vector2[] vector2s = new Vector2[4];
- vector2s[0] = new Vector2(-24, 132).scl(1 / Application.PPM);
- vector2s[1] = new Vector2(24, 132).scl(1 / Application.PPM);
- vector2s[2] = new Vector2(-20, 4).scl(1 / Application.PPM);
- vector2s[3] = new Vector2(20, 4).scl(1 / Application.PPM);
- shape.set(vector2s);
- fixtureDef.shape = shape;
- player2body.createFixture(fixtureDef).setUserData(this);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement