From d69f06fa547412cc59a81aeac6c64d1dbb2a3ada Mon Sep 17 00:00:00 2001 From: alestiago Date: Mon, 18 Apr 2022 11:01:15 +0100 Subject: [PATCH] feat: animated animatronic --- lib/game/components/flutter_forest.dart | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/game/components/flutter_forest.dart b/lib/game/components/flutter_forest.dart index bccd27f3..3c5f5a1f 100644 --- a/lib/game/components/flutter_forest.dart +++ b/lib/game/components/flutter_forest.dart @@ -25,7 +25,7 @@ class FlutterForest extends Component await super.onLoad(); gameRef.addContactCallback(_DashNestBumperBallContactCallback()); - final signPost = FlutterSignPost()..initialPosition = Vector2(8.35, 58.3); + final signPost = FlutterSignPost()..initialPosition = Vector2(8.35, -58.3); final bigNest = _BigDashNestBumper() ..initialPosition = Vector2(18.55, -59.35); @@ -58,15 +58,19 @@ class _FlutterForestController extends ComponentController final activatedBonus = _activatedBumpers.length == 3; if (activatedBonus) { - gameRef.read().add(const BonusActivated(GameBonus.dashNest)); _addBonusBall(); + + gameRef.read().add(const BonusActivated(GameBonus.dashNest)); _activatedBumpers ..forEach((bumper) => bumper.deactivate()) ..clear(); + + component.firstChild()?.playing = true; } } Future _addBonusBall() async { + // TODO(alestiago): Remove hardcoded duration. await Future.delayed(const Duration(milliseconds: 700)); await gameRef.add( ControlledBall.bonus(theme: gameRef.theme)