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