diff --git a/lib/game/components/plunger.dart b/lib/game/components/plunger.dart index d4c541f2..b319af80 100644 --- a/lib/game/components/plunger.dart +++ b/lib/game/components/plunger.dart @@ -14,7 +14,9 @@ class Plunger extends BodyComponent with KeyboardHandler, InitialPosition { /// {@macro plunger} Plunger({ required this.compressionDistance, - }) : super(priority: 5); + // TODO(ruimiguel): set to priority +1 over LaunchRamp once all priorities + // are fixed. + }) : super(priority: 0); /// Distance the plunger can lower. final double compressionDistance; @@ -112,7 +114,7 @@ class Plunger extends BodyComponent with KeyboardHandler, InitialPosition { size: Vector2(5.5, 40), anchor: Anchor.center, position: Vector2(2, 19), - angle: -0.035, + angle: -0.033, ), ); } diff --git a/lib/game/pinball_game.dart b/lib/game/pinball_game.dart index 3a04b341..0eb5fb41 100644 --- a/lib/game/pinball_game.dart +++ b/lib/game/pinball_game.dart @@ -21,6 +21,8 @@ class PinballGame extends Forge2DGame final PinballAudio audio; + late Plunger plunger; + @override void onAttach() { super.onAttach(); @@ -70,8 +72,8 @@ class PinballGame extends Forge2DGame } Future _addPlunger() async { - final plunger = Plunger(compressionDistance: 29) - ..initialPosition = Vector2(38, -19); + plunger = Plunger(compressionDistance: 29) + ..initialPosition = Vector2(38.2, -19); await add(plunger); } @@ -87,12 +89,6 @@ class PinballGame extends Forge2DGame } Future spawnBall() async { - // TODO(alestiago): Remove once this logic is moved to controller. - var plunger = firstChild(); - if (plunger == null) { - await add(plunger = Plunger(compressionDistance: 1)); - } - final ball = ControlledBall.launch( theme: theme, )..initialPosition = Vector2(