use of ilargia.egdx.util.FixtureDefBuilder in project Entitas-Java by Rubentxu.
the class Ground method create.
@Override
public GameEntity create(Engine engine, Context<GameEntity> context) {
BasePhysicsManager physics = engine.getManager(BasePhysicsManager.class);
BodyBuilder bodyBuilder = physics.getBodyBuilder();
Body bodyGround = bodyBuilder.fixture(new FixtureDefBuilder().boxShape(50, 0.5f).friction(0.5f)).build();
GameEntity entity = ((GameContext) context).createEntity().addRigidBody(bodyGround).addElement("Platform", "Ground");
return entity;
}
Aggregations