if (deserialized) {
return;
}
// Ground
{
BodyDef bd = new BodyDef();
Body ground = getWorld().createBody(bd);
EdgeShape shape = new EdgeShape();
shape.set(new Vec2(-20.0f, 0.0f), new Vec2(20.0f, 0.0f));
ground.createFixture(shape, 0.0f);
}
// Platform
{
BodyDef bd = new BodyDef();
bd.position.set(0.0f, 10.0f);
Body body = getWorld().createBody(bd);
PolygonShape shape = new PolygonShape();
shape.setAsBox(3.0f, 0.5f);
m_platform = body.createFixture(shape, 0.0f);
m_bottom = 10.0f - 0.5f;
m_top = 10.0f + 0.5f;
}
// Actor
{
BodyDef bd = new BodyDef();
bd.type = BodyType.DYNAMIC;
bd.position.set(0.0f, 12.0f);
Body body = getWorld().createBody(bd);
m_radius = 0.5f;