SHARE
TWEET

Untitled

a guest Sep 7th, 2014 163 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //PLAYER
  2. CircleShape shape=new CircleShape();
  3. shape.m_radius=Ruler.pixelsToWorld(24);
  4. FixtureDef f=new FixtureDef();
  5. f.shape=shape;
  6. f.density=3.2f;
  7. f.friction=1f;
  8. f.restitution=1f;
  9. BodyDef b=new BodyDef();
  10. b.type=BodyType.DYNAMIC;
  11. b.position=new Vec2(Ruler.tileToWorld(spawnPoint.x),Ruler.tileToWorld(spawnPoint.y));
  12. b.userData=this;
  13. body=game.getWorldManager().getWorld().createBody(b);
  14. body.createFixture(f);
  15.  
  16. //TILE
  17. BodyDef def=new BodyDef();
  18. def.position=new Vec2(Ruler.tileToWorld(i),Ruler.tileToWorld(j));
  19. def.type=BodyType.STATIC;
  20. FixtureDef f=new FixtureDef();
  21. f.density=1;
  22. f.friction=1;
  23. f.restitution=0.5f;
  24. PolygonShape shape=new PolygonShape();
  25. shape.setAsBox(Ruler.tileToWorld(0.5f), Ruler.tileToWorld(0.5f));
  26. f.shape=shape;
  27. Body b=world.createBody(def);
  28. b.createFixture(f);
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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top