Advertisement
Guest User

Untitled

a guest
Feb 14th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. Vector2[] box = new Vector2[4];
  2.  
  3. box[1] = new Vector2(0 - bounds.getWidth() / 2 / Main.PPM, 0 - bounds.getHeight() / 2 / Main.PPM);
  4.  
  5.  
  6. box[0] = new Vector2( bounds.getWidth() / 2 / Main.PPM, 0 - bounds.getHeight() / 2 / Main.PPM);
  7.  
  8.  
  9. box[2] = new Vector2(0 - bounds.getWidth() / 2 / Main.PPM, bounds.getHeight() / 2 / Main.PPM);
  10.  
  11.  
  12. box[3] = new Vector2( bounds.getWidth() / 2 / Main.PPM, bounds.getHeight() / 2 / Main.PPM);
  13.  
  14. ChainShape chainShape = new ChainShape();
  15. chainShape.createLoop(box);
  16.  
  17. fdef.shape = chainShape;
  18. fixture = body.createFixture(fdef);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement