- //PLAYER
- CircleShape shape=new CircleShape();
- shape.m_radius=Ruler.pixelsToWorld(24);
- FixtureDef f=new FixtureDef();
- f.shape=shape;
- f.density=3.2f;
- f.friction=1f;
- f.restitution=1f;
- BodyDef b=new BodyDef();
- b.type=BodyType.DYNAMIC;
- b.position=new Vec2(Ruler.tileToWorld(spawnPoint.x),Ruler.tileToWorld(spawnPoint.y));
- b.userData=this;
- body=game.getWorldManager().getWorld().createBody(b);
- body.createFixture(f);
- //TILE
- BodyDef def=new BodyDef();
- def.position=new Vec2(Ruler.tileToWorld(i),Ruler.tileToWorld(j));
- def.type=BodyType.STATIC;
- FixtureDef f=new FixtureDef();
- f.density=1;
- f.friction=1;
- f.restitution=0.5f;
- PolygonShape shape=new PolygonShape();
- shape.setAsBox(Ruler.tileToWorld(0.5f), Ruler.tileToWorld(0.5f));
- f.shape=shape;
- Body b=world.createBody(def);
- b.createFixture(f);
SHARE
TWEET
Untitled
a guest
Sep 7th, 2014
163
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
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.
