diff --git a/lib/game/pinball_game.dart b/lib/game/pinball_game.dart index 6d8bf34b..4985687b 100644 --- a/lib/game/pinball_game.dart +++ b/lib/game/pinball_game.dart @@ -95,12 +95,13 @@ class PinballGame extends Forge2DGame Future _addPlunger() async { plunger = Plunger( compressionDistance: camera.viewport.effectiveSize.y / 12, - )..initialPosition = screenToWorld( - Vector2( - camera.viewport.effectiveSize.x / 1.035, - camera.viewport.effectiveSize.y - plunger.compressionDistance, - ), - ); + ); + plunger.initialPosition = screenToWorld( + Vector2( + camera.viewport.effectiveSize.x / 1.035, + camera.viewport.effectiveSize.y - plunger.compressionDistance, + ), + ); await add(plunger); } diff --git a/test/game/components/plunger_test.dart b/test/game/components/plunger_test.dart index 4512db52..f0b4abfe 100644 --- a/test/game/components/plunger_test.dart +++ b/test/game/components/plunger_test.dart @@ -220,7 +220,6 @@ void main() { final flameTester = flameBlocTester(gameBloc: () => gameBloc); group('initializes with', () { - // FIXME(alestiago): Plunger not initialized error. flameTester.test( 'plunger body as bodyA', (game) async {