Example usage for com.badlogic.gdx.physics.box2d ChainShape createLoop

List of usage examples for com.badlogic.gdx.physics.box2d ChainShape createLoop

Introduction

In this page you can find the example usage for com.badlogic.gdx.physics.box2d ChainShape createLoop.

Prototype

public void createLoop(Vector2[] vertices) 

Source Link

Document

Create a loop.

Usage

From source file:com.stercore.code.net.dermetfan.utils.libgdx.box2d.Box2DUtils.java

License:Apache License

/** creates a deep copy of a {@link Shape}<br>
 *  <strong>Note: The {@link ChainShape#setPrevVertex(float, float) previous} and {@link ChainShape#setNextVertex(float, float) next} vertex of a {@link ChainShape} will not be copied since this is not possible due to the API.</strong>
 *  @param shape the {@link Shape} to copy
 *  @return a {@link Shape} exactly like the one passed in */
@SuppressWarnings("unchecked")
public static <T extends Shape> T clone(T shape) {
    T clone;//  w  ww.j a v a2s  .  com
    switch (shape.getType()) {
    case Circle:
        CircleShape circleClone = (CircleShape) (clone = (T) new CircleShape());
        circleClone.setPosition(((CircleShape) shape).getPosition());
        break;
    case Polygon:
        PolygonShape polyClone = (PolygonShape) (clone = (T) new PolygonShape()), poly = (PolygonShape) shape;
        float[] vertices = new float[poly.getVertexCount()];
        for (int i = 0; i < vertices.length; i++) {
            poly.getVertex(i, vec2_0);
            vertices[i++] = vec2_0.x;
            vertices[i] = vec2_0.y;
        }
        polyClone.set(vertices);
        break;
    case Edge:
        EdgeShape edgeClone = (EdgeShape) (clone = (T) new EdgeShape()), edge = (EdgeShape) shape;
        edge.getVertex1(vec2_0);
        edge.getVertex2(vec2_1);
        edgeClone.set(vec2_0, vec2_1);
        break;
    case Chain:
        ChainShape chainClone = (ChainShape) (clone = (T) new ChainShape()), chain = (ChainShape) shape;
        vertices = new float[chain.getVertexCount()];
        for (int i = 0; i < vertices.length; i++) {
            chain.getVertex(i, vec2_0);
            vertices[i++] = vec2_0.x;
            vertices[i] = vec2_0.y;
        }
        if (chain.isLooped())
            chainClone.createLoop(GeometryUtils.toVector2Array(vertices));
        else
            chainClone.createChain(vertices);
        break;
    default:
        return null;
    }
    clone.setRadius(shape.getRadius());
    return clone;
}

From source file:com.strategames.engine.gameobject.types.Door.java

License:Open Source License

@Override
protected void setupBody(Body body) {
    Vector2 leftBottom = new Vector2(0, 0);
    Vector2 rightBottom = new Vector2(WIDTH, 0);
    Vector2 rightTop = new Vector2(WIDTH, HEIGHT);
    Vector2 leftTop = new Vector2(0, HEIGHT);

    ChainShape chain = new ChainShape();
    chain.createLoop(new Vector2[] { leftBottom, rightBottom, rightTop, leftTop });

    Fixture fixture = body.createFixture(chain, 0.0f);
    fixture.setSensor(true);//from w ww.ja  va2 s.c om
}

From source file:com.strategames.engine.gameobject.types.RectangularSensor.java

License:Open Source License

@Override
protected void setupBody(Body body) {

    if (this.start == null) {
        this.start = new Vector2(0, 0);
    }/*from w  w w . ja v a 2 s. com*/

    if (this.end == null) {
        GameEngine game = getGame();
        Vector3 worldSize = game.getWorldSize();
        this.end = new Vector2(worldSize.x, worldSize.y).add(Wall.WIDTH, Wall.HEIGHT);
    }

    Vector2 leftBottom = new Vector2(start.x, start.y);
    Vector2 rightBottom = new Vector2(end.x, start.y);
    Vector2 rightTop = new Vector2(end.x, end.y);
    Vector2 leftTop = new Vector2(start.x, end.y);

    ChainShape chain = new ChainShape();
    chain.createLoop(new Vector2[] { leftBottom, rightBottom, rightTop, leftTop });
    Fixture fixture = body.createFixture(chain, 0.0f);
    fixture.setSensor(true);
}

From source file:com.talas777.ZombieLord.LevelObject.java

License:Open Source License

public ChainShape getCollisionBoundary() {
    if (!collision)
        return null;
    ChainShape shape = new ChainShape();

    shape.createLoop(this.getCollisionVectors());
    return shape;
}

From source file:com.talas777.ZombieLord.Levels.Church.java

License:Open Source License

@Override
public void applyCollisionBoundaries(World world, float pixels_per_meter) {
    BodyDef groundBodyDef = new BodyDef();
    groundBodyDef.type = BodyDef.BodyType.StaticBody;
    Body groundBody = world.createBody(groundBodyDef);
    { // church/*from  w w  w.ja  v a  2 s .c o m*/
        ChainShape environmentShape = new ChainShape();

        Vector2[] vertices = vectorize(
                new float[] { 439, 439, 477, 477, 566, 566, 563, 470, 470, 442, 442, 425, 425, 440, 440, 603,
                        603, 538, 538, 505, 505 },
                new float[] { 389, 449, 449, 497, 497, 540, 527, 527, 478, 478, 485, 485, 518, 518, 614, 614,
                        388, 388, 380, 380, 389 });

        environmentShape.createLoop(vertices);
        groundBody.createFixture(environmentShape, 0);
        environmentShape.dispose();
    }

}

From source file:com.talas777.ZombieLord.Levels.EastHouse.java

License:Open Source License

@Override
public void applyCollisionBoundaries(World world, float pixels_per_meter) {
    BodyDef groundBodyDef = new BodyDef();
    groundBodyDef.type = BodyDef.BodyType.StaticBody;
    Body groundBody = world.createBody(groundBodyDef);

    { // everything
        ChainShape environmentShape = new ChainShape();

        Vector2[] vertices = vectorize(
                new float[] { 223, 223, 185, 185, 171, 171, 159, 159, 190, 190, 159, 159, 215, 215, 255, 258,
                        288, 288, 297, 297, 329, 329, 320, 320, 351, 359, 256, 256 },
                new float[] { 106, 127, 129, 148, 148, 158, 158, 196, 196, 223, 223, 257, 257, 311, 311, 321,
                        321, 315, 311, 224, 224, 211, 211, 165, 165, 126, 126, 103 });

        environmentShape.createLoop(vertices);
        groundBody.createFixture(environmentShape, 0);
        environmentShape.dispose();/*from  ww w .  j  a v a2s  . c  o m*/
    }

}

From source file:com.talas777.ZombieLord.Levels.HomeTown.java

License:Open Source License

@Override
public void applyCollisionBoundaries(World world, float pixels_per_meter) {
    // TODO Auto-generated method stub

    BodyDef groundBodyDef = new BodyDef();
    groundBodyDef.type = BodyDef.BodyType.StaticBody;
    Body groundBody = world.createBody(groundBodyDef);
    { // church/*from   ww  w  .  j ava  2 s .com*/
        ChainShape environmentShape = new ChainShape();

        Vector2[] vertices = vectorize(
                new float[] { 1473, 1473, 1507, 1700, 1775, 1861, 1950, 1985, 1985, 1795, 1795, 1758, 1758 },
                new float[] { 322, 450, 480, 480, 565, 480, 480, 450, 322, 322, 342, 342, 322 });

        environmentShape.createLoop(vertices);
        groundBody.createFixture(environmentShape, 0);
        environmentShape.dispose();
    }
    { // gravestone 1
        ChainShape environmentShape = new ChainShape();

        Vector2[] vertices = vectorize(new float[] { 1898, 1898, 1941, 1941 },
                new float[] { 225, 265, 265, 225 });

        environmentShape.createLoop(vertices);
        groundBody.createFixture(environmentShape, 0);
        environmentShape.dispose();
    }
    { // gravestone 2
        ChainShape environmentShape = new ChainShape();

        Vector2[] vertices = vectorize(new float[] { 1953, 1953, 1985, 1985 },
                new float[] { 288, 322, 322, 288 });

        environmentShape.createLoop(vertices);
        groundBody.createFixture(environmentShape, 0);
        environmentShape.dispose();
    }
    { // gravestones 3
        ChainShape environmentShape = new ChainShape();

        Vector2[] vertices = vectorize(new float[] { 1989, 1989, 2106, 2106 },
                new float[] { 226, 254, 254, 226 });

        environmentShape.createLoop(vertices);
        groundBody.createFixture(environmentShape, 0);
        environmentShape.dispose();
    }
    { // gravestones 4
        ChainShape environmentShape = new ChainShape();

        Vector2[] vertices = vectorize(
                new float[] { 2026, 2026, 2043, 2043, 2047, 2047, 2107, 2107, 2069, 2069 },
                new float[] { 289, 329, 340, 350, 350, 382, 382, 352, 352, 289 });

        environmentShape.createLoop(vertices);
        groundBody.createFixture(environmentShape, 0);
        environmentShape.dispose();
    }
    { // gravestones 5
        ChainShape environmentShape = new ChainShape();

        Vector2[] vertices = vectorize(new float[] { 1985, 1985, 2008, 2000 },
                new float[] { 353, 382, 382, 353 });

        environmentShape.createLoop(vertices);
        groundBody.createFixture(environmentShape, 0);
        environmentShape.dispose();
    }
    { // gravestone 6
        ChainShape environmentShape = new ChainShape();

        Vector2[] vertices = vectorize(new float[] { 2110, 2110, 2129, 2138, 2144 },
                new float[] { 288, 352, 352, 345, 290 });

        environmentShape.createLoop(vertices);
        groundBody.createFixture(environmentShape, 0);
        environmentShape.dispose();
    }
    { // farm fence (only outer)
        ChainShape environmentShape = new ChainShape();

        Vector2[] vertices = vectorize(
                new float[] { 2445, 2445, 2476, 2476, 2975, 2975, 2931, 2931, 3040, 3040, 3008, 3008, 3085,
                        3085, 3200 },
                new float[] { 1, 734, 734, 797, 797, 774, 774, 734, 734, 776, 776, 797, 797, 828, 828 });

        environmentShape.createChain(vertices); // not a loop!
        groundBody.createFixture(environmentShape, 0);
        environmentShape.dispose();
    }

    { // pond (near square)
        ChainShape environmentShape = new ChainShape();

        Vector2[] vertices = vectorize(
                new float[] { 1906, 1906, 1961, 1971, 2026, 2026, 2002, 2002, 2022, 2047, 2150, 2162, 2162,
                        2217, 2224, 2274, 2289, 2315, 2324, 2380, 2380, 2305, 2293, 2280, 2200, 2190, 2159,
                        2159, 2135, 2122, 2002, 2002, 1970, 1970 },
                new float[] { 1048, 1135, 1135, 1108, 1108, 1127, 1151, 1194, 1194, 1232, 1232, 1254, 1293,
                        1293, 1172, 1171, 1143, 1136, 1108, 1101, 1010, 1010, 1000, 979, 979, 1001, 1001, 952,
                        939, 883, 883, 935, 953, 1033 });

        environmentShape.createLoop(vertices);
        groundBody.createFixture(environmentShape, 0);
        environmentShape.dispose();
    }

    { // top houses and fence
        ChainShape environmentShape = new ChainShape();

        Vector2[] vertices = vectorize(
                new float[] { 3206, 3138, 3138, 3099, 3099, 2946, 2946, 2908, 2908, 2880, 2880, 2754, 2754,
                        2717, 2717, 2689, 2689, 2654, 2654, 2563, 2563, 2348, 2348, 2304, 2304, 2207, 2207,
                        2112, 2112, 2077, 2077, 2020, 2016, 1922, 1922, 1953, 2269, 2303, 2303, 2403, 2403,
                        2369, 2388, 2479 },
                new float[] { 1409, 1409, 1446, 1446, 1408, 1408, 1439, 1439, 1409, 1409, 1440, 1440, 1505,
                        1505, 1442, 1442, 1477, 1477, 1440, 1440, 1512, 1512, 1799, 1799, 1666, 1666, 1536,
                        1536, 1569, 1569, 1536, 1536, 1730, 1730, 1974, 1983, 1983, 1974, 1822, 1822, 1859,
                        1874, 1925, 1948 });

        environmentShape.createLoop(vertices);
        groundBody.createFixture(environmentShape, 0);
        environmentShape.dispose();
    }
    { // bottom right house
        ChainShape environmentShape = new ChainShape();

        Vector2[] vertices = vectorize(new float[] { 2945, 2945, 2974, 3103, 3136, 3136, 3042, 3042 },
                new float[] { 1122, 1301, 1310, 1310, 1301, 1090, 1090, 1121 });

        environmentShape.createLoop(vertices);
        groundBody.createFixture(environmentShape, 0);
        environmentShape.dispose();
    }
    { // bottom left house
        ChainShape environmentShape = new ChainShape();

        Vector2[] vertices = vectorize(
                new float[] { 2658, 2658, 2627, 2626, 2657, 2848, 2880, 2876, 2845, 2845, 2816, 2816, 2784,
                        2784 },
                new float[] { 1121, 1154, 1154, 1332, 1342, 1342, 1334, 1152, 1152, 1120, 1120, 1152, 1152,
                        1120 });

        environmentShape.createLoop(vertices);
        groundBody.createFixture(environmentShape, 0);
        environmentShape.dispose();
    }
    { // big tree (at square)
        ChainShape environmentShape = new ChainShape();

        Vector2[] vertices = vectorize(
                new float[] { 1771, 1750, 1702, 1698, 1709, 1750, 1766, 1792, 1824, 1824, 1816, 1797 },
                new float[] { 1417, 1417, 1439, 1480, 1539, 1583, 1592, 1580, 1515, 1496, 1469, 1453 });

        environmentShape.createLoop(vertices);
        groundBody.createFixture(environmentShape, 0);
        environmentShape.dispose();
    }
    { // border, fences, water
        ChainShape environmentShape = new ChainShape();

        Vector2[] vertices = vectorize(
                new float[] { 3197, 1008, 1008, 950, 942, 916, 910, 910, 910, 980, 980, 950, 950, 1195, 1360,
                        1335, 1423, 1423, 1477, 1508, 1544, 1545, 1545, 1480, 1489, 1469, 1457, 1457, 1430,
                        1325, 1325, 1354, 1354, 1298, 1291, 1291, 1266, 1262, 1231, 1226, 1226, 1194, 1113,
                        1076, 1075, 1075, 1041, 1041, 915, 914, 897, 533, 533, 1328, 1328, 1427, 1454, 1454,
                        1504, 1539, 1677, 1759, 1759, 1654, 1653, 2357, 2357, 2700, 2700, 2796, 2796, 2755,
                        2716, 2715, 2631, 2587, 2539, 2533, 2533, 2484, 2467, 2386, 2377, 2383, 2382, 3198 },
                new float[] { 1, 2, 82, 82, 115, 119, 147, 198, 199, 257, 518, 540, 683, 687, 865, 911, 911,
                        978, 979, 1012, 1012, 1012, 1041, 1105, 1153, 1178, 1209, 1389, 1406, 1402, 1342, 1320,
                        1241, 1199, 1147, 1146, 1133, 984, 969, 921, 920, 888, 888, 922, 922, 1006, 1007, 980,
                        980, 980, 1008, 1019, 1558, 1576, 1442, 1442, 1466, 1535, 1584, 1584, 1714, 1714, 1781,
                        1782, 2888, 2888, 2922, 2922, 2728, 2728, 2377, 2327, 2327, 2327, 2232, 2232, 2172,
                        2137, 2136, 2128, 2040, 2035, 1958, 1938, 1938, 1467 });

        environmentShape.createLoop(vertices);
        groundBody.createFixture(environmentShape, 0);
        environmentShape.dispose();
    }
    { // water
        ChainShape environmentShape = new ChainShape();

        Vector2[] vertices = vectorize(
                new float[] { 1793, 1793, 1793, 1835, 1853, 1910, 1910, 1876, 1862, 1845, 1831 },
                new float[] { 1712, 1776, 1777, 1777, 1809, 1809, 1778, 1770, 1743, 1737, 1716 });

        environmentShape.createLoop(vertices);
        groundBody.createFixture(environmentShape, 0);
        environmentShape.dispose();
    }
    { // stall1
        ChainShape environmentShape = new ChainShape();

        Vector2[] vertices = vectorize(new float[] { 2945, 2945, 3007, 3007 },
                new float[] { 885, 1009, 1009, 885 });

        environmentShape.createLoop(vertices);
        groundBody.createFixture(environmentShape, 0);
        environmentShape.dispose();
    }
    { // stall2
        ChainShape environmentShape = new ChainShape();

        Vector2[] vertices = vectorize(new float[] { 3039, 3039, 3103, 3104 },
                new float[] { 887, 1009, 1009, 888 });

        environmentShape.createLoop(vertices);
        groundBody.createFixture(environmentShape, 0);
        environmentShape.dispose();
    }
    { // stall3
        ChainShape environmentShape = new ChainShape();

        Vector2[] vertices = vectorize(new float[] { 3136, 3136, 3166, 3167 },
                new float[] { 888, 976, 976, 888 });

        environmentShape.createLoop(vertices);
        groundBody.createFixture(environmentShape, 0);
        environmentShape.dispose();
    }

}

From source file:com.talas777.ZombieLord.Levels.MayorHouse.java

License:Open Source License

@Override
public void applyCollisionBoundaries(World world, float pixels_per_meter) {
    BodyDef groundBodyDef = new BodyDef();
    groundBodyDef.type = BodyDef.BodyType.StaticBody;
    Body groundBody = world.createBody(groundBodyDef);
    { // walls and near walls
        ChainShape environmentShape = new ChainShape();

        Vector2[] vertices = vectorize(
                new float[] { 292, 292, 192, 192, 288, 288, 511, 511, 544, 544, 607, 607, 575, 575, 607, 607,
                        540, 540, 578, 578, 560, 544, 544, 515, 461, 461, 479, 479, 464, 449, 449, 376, 376 },
                new float[] { 0, 30, 30, 255, 256, 541, 541, 516, 516, 539, 539, 512, 512, 487, 487, 191, 191,
                        231, 231, 277, 351, 275, 235, 224, 224, 182, 182, 97, 97, 75, 32, 32, 2 });

        environmentShape.createLoop(vertices);
        groundBody.createFixture(environmentShape, 0);
        environmentShape.dispose();// w  w  w .  j av  a  2  s  . c o  m
    }
    { // table and chairs
        ChainShape environmentShape = new ChainShape();

        Vector2[] vertices = vectorize(new float[] { 409, 409, 418, 504, 517, 542, 542, 534, 519, 505, 421 },
                new float[] { 337, 413, 447, 447, 412, 413, 386, 349, 337, 321, 321 });

        environmentShape.createLoop(vertices);
        groundBody.createFixture(environmentShape, 0);
        environmentShape.dispose();
    }
    { // table and chairs
        ChainShape environmentShape = new ChainShape();

        Vector2[] vertices = vectorize(new float[] { 234, 240, 230, 221, 221, 210, 192 },
                new float[] { 30, 75, 93, 105, 125, 133, 133 });

        environmentShape.createLoop(vertices);
        groundBody.createFixture(environmentShape, 0);
        environmentShape.dispose();
    }

}

From source file:com.talas777.ZombieLord.Levels.MyHouse.java

License:Open Source License

@Override
public void applyCollisionBoundaries(World world, float pixels_per_meter) {
    BodyDef groundBodyDef = new BodyDef();
    groundBodyDef.type = BodyDef.BodyType.StaticBody;
    Body groundBody = world.createBody(groundBodyDef);
    { // everything
        ChainShape environmentShape = new ChainShape();

        Vector2[] vertices = vectorize(
                new float[] { 420, 420, 288, 288, 32, 32, 223, 223, 254, 254, 223, 223, 351, 351, 224, 224, 255,
                        259, 276, 290, 319, 319, 349, 370, 393, 414, 420, 454, 454, 579, 579, 607, 607, 580,
                        580, 607, 607, 580, 580, 477, 477, 416 },
                new float[] { 161, 190, 190, 288, 288, 321, 321, 385, 385, 414, 414, 439, 439, 479, 479, 543,
                        543, 517, 517, 535, 535, 524, 524, 519, 513, 513, 544, 544, 448, 448, 398, 398, 318,
                        318, 287, 287, 253, 244, 191, 191, 163, 163 });

        environmentShape.createLoop(vertices);
        groundBody.createFixture(environmentShape, 0);
        environmentShape.dispose();/*from w  ww . ja  va 2s . c  o  m*/
    }

}

From source file:com.talas777.ZombieLord.Levels.SecondTown.java

License:Open Source License

@Override
public void applyCollisionBoundaries(World world, float pixels_per_meter) {
    BodyDef groundBodyDef = new BodyDef();
    groundBodyDef.type = BodyDef.BodyType.StaticBody;
    Body groundBody = world.createBody(groundBodyDef);
    { // borders/* w w w  .ja  va 2  s.  c o m*/
        ChainShape environmentShape = new ChainShape();

        Vector2[] vertices = vectorize(new float[] { 1, 1, 1215, 1215 }, new float[] { 930, 2016, 2016, 930 });

        environmentShape.createLoop(vertices);
        groundBody.createFixture(environmentShape, 0);
        environmentShape.dispose();
    }
    { // inn
        ChainShape environmentShape = new ChainShape();

        Vector2[] vertices = vectorize(
                new float[] { 897, 801, 799, 830, 1149, 1183, 1183, 1025, 1021, 928, 928, 897 },
                new float[] { 1797, 1799, 1972, 1983, 1983, 1972, 1604, 1602, 1795, 1797, 1811, 1811 });

        environmentShape.createLoop(vertices);
        groundBody.createFixture(environmentShape, 0);
        environmentShape.dispose();
    }
    { // left house
        ChainShape environmentShape = new ChainShape();

        Vector2[] vertices = vectorize(new float[] { 415, 385, 382, 415, 510, 542, 539, 447, 446, 414 },
                new float[] { 1253, 1253, 1428, 1440, 1439, 1426, 1255, 1253, 1268, 1269 });

        environmentShape.createLoop(vertices);
        groundBody.createFixture(environmentShape, 0);
        environmentShape.dispose();
    }
    { // right house
        ChainShape environmentShape = new ChainShape();

        Vector2[] vertices = vectorize(new float[] { 798, 769, 767, 799, 927, 958, 955, 830, 830, 798 },
                new float[] { 1348, 1347, 1492, 1504, 1504, 1492, 1348, 1348, 1362, 1362 });

        environmentShape.createLoop(vertices);
        groundBody.createFixture(environmentShape, 0);
        environmentShape.dispose();
    }
    { // strange tent
        ChainShape environmentShape = new ChainShape();

        Vector2[] vertices = vectorize(new float[] { 965, 965, 1023, 1081, 1081 },
                new float[] { 1126, 1227, 1275, 1227, 1126 });

        environmentShape.createLoop(vertices);
        groundBody.createFixture(environmentShape, 0);
        environmentShape.dispose();
    }
    { // apple tree
        ChainShape environmentShape = new ChainShape();

        Vector2[] vertices = vectorize(new float[] { 649, 649, 660, 660 },
                new float[] { 1286, 1312, 1312, 1286 });

        environmentShape.createLoop(vertices);
        groundBody.createFixture(environmentShape, 0);
        environmentShape.dispose();
    }
    { // middle tree 1
        ChainShape environmentShape = new ChainShape();

        Vector2[] vertices = vectorize(new float[] { 457, 457, 469, 469 },
                new float[] { 1542, 1568, 1568, 1542 });

        environmentShape.createLoop(vertices);
        groundBody.createFixture(environmentShape, 0);
        environmentShape.dispose();
    }
    { // middle tree 2
        ChainShape environmentShape = new ChainShape();

        Vector2[] vertices = vectorize(new float[] { 553, 553, 564, 564 },
                new float[] { 1607, 1633, 1633, 1607 });

        environmentShape.createLoop(vertices);
        groundBody.createFixture(environmentShape, 0);
        environmentShape.dispose();
    }
    { // fir 1 (upper)
        ChainShape environmentShape = new ChainShape();

        Vector2[] vertices = vectorize(new float[] { 327, 327, 342, 342 },
                new float[] { 1893, 1939, 1939, 1893 });

        environmentShape.createLoop(vertices);
        groundBody.createFixture(environmentShape, 0);
        environmentShape.dispose();
    }
    { // fir 2 (right)
        ChainShape environmentShape = new ChainShape();

        Vector2[] vertices = vectorize(new float[] { 40, 40, 54, 54 }, new float[] { 1317, 1366, 1366, 1317 });

        environmentShape.createLoop(vertices);
        groundBody.createFixture(environmentShape, 0);
        environmentShape.dispose();
    }
    { // fir 3 (south)
        ChainShape environmentShape = new ChainShape();

        Vector2[] vertices = vectorize(new float[] { 840, 840, 854, 854 },
                new float[] { 967, 1013, 1013, 967 });

        environmentShape.createLoop(vertices);
        groundBody.createFixture(environmentShape, 0);
        environmentShape.dispose();
    }
    { // gravestones (2 south)
        ChainShape environmentShape = new ChainShape();

        Vector2[] vertices = vectorize(new float[] { 197, 197, 216, 216 },
                new float[] { 1088, 1149, 1149, 1087 });

        environmentShape.createLoop(vertices);
        groundBody.createFixture(environmentShape, 0);
        environmentShape.dispose();
    }
    { // gravestone (leftmost)
        ChainShape environmentShape = new ChainShape();

        Vector2[] vertices = vectorize(new float[] { 132, 132, 154, 154 },
                new float[] { 1154, 1181, 1181, 1157 });

        environmentShape.createLoop(vertices);
        groundBody.createFixture(environmentShape, 0);
        environmentShape.dispose();
    }
    { // gravestone (middle)
        ChainShape environmentShape = new ChainShape();

        Vector2[] vertices = vectorize(new float[] { 198, 198, 213, 213 },
                new float[] { 1190, 1210, 1210, 1190 });

        environmentShape.createLoop(vertices);
        groundBody.createFixture(environmentShape, 0);
        environmentShape.dispose();
    }
    { // gravestone (rightmost)
        ChainShape environmentShape = new ChainShape();

        Vector2[] vertices = vectorize(new float[] { 263, 263, 278, 278 },
                new float[] { 1190, 1211, 1211, 1190 });

        environmentShape.createLoop(vertices);
        groundBody.createFixture(environmentShape, 0);
        environmentShape.dispose();
    }

}