mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-02 20:13:50 +08:00
Fix cascade notation
This commit is contained in:
@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user