import 'package:flame_forge2d/flame_forge2d.dart'; class Wall extends BodyComponent { Wall(this.start, this.end); final Vector2 start; final Vector2 end; @override Body createBody() { final shape = EdgeShape()..set(start, end); final fixtureDef = FixtureDef(shape) ..restitution = 0.0 ..friction = 0.3; final bodyDef = BodyDef() ..userData = this ..position = Vector2.zero() ..type = BodyType.static; return world.createBody(bodyDef)..createFixture(fixtureDef); } }