Fix cascade notation

This commit is contained in:
Lukas Klingsbo
2020-05-02 18:02:10 +02:00
parent ac81bbab97
commit 2653af8afe
2 changed files with 18 additions and 18 deletions

View File

@ -42,15 +42,15 @@ class Wall extends BodyComponent {
final PolygonShape shape = PolygonShape(); final PolygonShape shape = PolygonShape();
shape.setAsEdge(start, end); shape.setAsEdge(start, end);
final fixtureDef = FixtureDef(); final fixtureDef = FixtureDef()
fixtureDef.setUserData(this); // To be able to determine object in collision ..setUserData(this) // To be able to determine object in collision
fixtureDef.shape = shape; ..shape = shape
fixtureDef.restitution = 0.0; ..restitution = 0.0
fixtureDef.friction = 0.1; ..friction = 0.1;
final bodyDef = BodyDef(); final bodyDef = BodyDef()
bodyDef.position = Vector2.zero(); ..position = Vector2.zero()
bodyDef.type = BodyType.STATIC; ..type = BodyType.STATIC;
body = world.createBody(bodyDef)..createFixtureFromFixtureDef(fixtureDef); body = world.createBody(bodyDef)..createFixtureFromFixtureDef(fixtureDef);
} }

View File

@ -35,17 +35,17 @@ class Ball extends BodyComponent {
final CircleShape shape = CircleShape(); final CircleShape shape = CircleShape();
shape.radius = radius; shape.radius = radius;
final fixtureDef = FixtureDef(); final fixtureDef = FixtureDef()
// To be able to determine object in collision // To be able to determine object in collision
fixtureDef.setUserData(this); ..setUserData(this)
fixtureDef.shape = shape; ..shape = shape
fixtureDef.restitution = 1.0; ..restitution = 1.0
fixtureDef.density = 1.0; ..density = 1.0
fixtureDef.friction = 0.1; ..friction = 0.1;
final bodyDef = BodyDef(); final bodyDef = BodyDef()
bodyDef.position = position; ..position = position
bodyDef.type = BodyType.DYNAMIC; ..type = BodyType.DYNAMIC;
body = world.createBody(bodyDef)..createFixtureFromFixtureDef(fixtureDef); body = world.createBody(bodyDef)..createFixtureFromFixtureDef(fixtureDef);
} }