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();
shape.setAsEdge(start, end);
final fixtureDef = FixtureDef();
fixtureDef.setUserData(this); // To be able to determine object in collision
fixtureDef.shape = shape;
fixtureDef.restitution = 0.0;
fixtureDef.friction = 0.1;
final fixtureDef = FixtureDef()
..setUserData(this) // To be able to determine object in collision
..shape = shape
..restitution = 0.0
..friction = 0.1;
final bodyDef = BodyDef();
bodyDef.position = Vector2.zero();
bodyDef.type = BodyType.STATIC;
final bodyDef = BodyDef()
..position = Vector2.zero()
..type = BodyType.STATIC;
body = world.createBody(bodyDef)..createFixtureFromFixtureDef(fixtureDef);
}

View File

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