Package com.badlogic.gdx.physics.box2d

Examples of com.badlogic.gdx.physics.box2d.ChainShape


  private void createPhysicsWorld() {

    world = new World(new Vector2(0, 0), true);
   
    float halfWidth = viewportWidth / 2f;
    ChainShape chainShape = new ChainShape();
    chainShape.createLoop(new Vector2[] {
        new Vector2(-halfWidth, 0f),
        new Vector2(halfWidth, 0f),
        new Vector2(halfWidth, viewportHeight),
        new Vector2(-halfWidth, viewportHeight) });
    BodyDef chainBodyDef = new BodyDef();
    chainBodyDef.type = BodyType.StaticBody;
    groundBody = world.createBody(chainBodyDef);
    groundBody.createFixture(chainShape, 0);
    chainShape.dispose();
    createBoxes();
  }
View Full Code Here

TOP

Related Classes of com.badlogic.gdx.physics.box2d.ChainShape

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.