diff --git a/packages/pinball_components/lib/src/components/plunger.dart b/packages/pinball_components/lib/src/components/plunger.dart index 70d33600..eb20e12d 100644 --- a/packages/pinball_components/lib/src/components/plunger.dart +++ b/packages/pinball_components/lib/src/components/plunger.dart @@ -15,7 +15,9 @@ class Plunger extends BodyComponent with KeyboardHandler, InitialPosition { required this.compressionDistance, // TODO(ruimiguel): set to priority +1 over LaunchRamp once all priorities // are fixed. - }) : super(priority: 0); + }) : super(priority: 0) { + renderBody = false; + } /// Distance the plunger can lower. final double compressionDistance; @@ -96,9 +98,6 @@ class Plunger extends BodyComponent with KeyboardHandler, InitialPosition { Future onLoad() async { await super.onLoad(); await _anchorToJoint(); - - renderBody = false; - await _loadSprite(); } @@ -135,12 +134,8 @@ class PlungerAnchor extends JointAnchor { @override Body createBody() { - final shape = CircleShape()..radius = 0.5; - final fixtureDef = FixtureDef(shape); - final bodyDef = BodyDef() - ..position = initialPosition - ..type = BodyType.static; - return world.createBody(bodyDef)..createFixture(fixtureDef); + final bodyDef = BodyDef()..position = initialPosition; + return world.createBody(bodyDef); } }