diff --git a/packages/pinball_components/lib/src/components/chrome_dino.dart b/packages/pinball_components/lib/src/components/chrome_dino.dart index 4cf954e1..6c419581 100644 --- a/packages/pinball_components/lib/src/components/chrome_dino.dart +++ b/packages/pinball_components/lib/src/components/chrome_dino.dart @@ -26,7 +26,9 @@ class ChromeDino extends BodyComponent with InitialPosition { /// Anchors the [ChromeDino] to the [RevoluteJoint] that controls its arc /// motion. Future<_ChromeDinoJoint> _anchorToJoint() async { - final anchor = _ChromeDinoAnchor(); + final anchor = _ChromeDinoAnchor() + ..initialPosition = initialPosition + Vector2(9, -4); + await add(anchor); final jointDef = _ChromeDinoAnchorRevoluteJointDef( @@ -85,12 +87,7 @@ class ChromeDino extends BodyComponent with InitialPosition { } class _ChromeDinoAnchor extends JointAnchor { - _ChromeDinoAnchor() { - initialPosition = Vector2( - ChromeDino.size.x / 2 + 9, - ChromeDino.size.y / 2 - 4, - ); - } + _ChromeDinoAnchor(); // TODO(allisonryan0002): if these aren't moved when fixing the rendering, see // if the joint can be created in onMount to resolve render syncing.