SHARE
TWEET

Untitled

a guest Nov 14th, 2017 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         BodyDef bodyDef = new BodyDef();
  2.         bodyDef.linearDamping = 1f;
  3.         MapLayers mapLayers = screen.getTiledMap().getLayers();
  4.         MapLayer mapLayerPlayer = mapLayers.get("player_position");
  5.         bodyDef.type = BodyDef.BodyType.DynamicBody;
  6.         player2body = world.createBody(bodyDef);
  7.         FixtureDef fixtureDef = new FixtureDef();
  8.         PolygonShape shape = new PolygonShape();
  9.         Vector2[] vector2s = new Vector2[4];
  10.         vector2s[0] = new Vector2(-24, 132).scl(1 / Application.PPM);
  11.         vector2s[1] = new Vector2(24, 132).scl(1 / Application.PPM);
  12.         vector2s[2] = new Vector2(-20, 4).scl(1 / Application.PPM);
  13.         vector2s[3] = new Vector2(20, 4).scl(1 / Application.PPM);
  14.         shape.set(vector2s);
  15.         fixtureDef.shape = shape;
  16.         player2body.createFixture(fixtureDef).setUserData(this);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top