diff --git a/lib/game/components/board.dart b/lib/game/components/board.dart index a312daee..41581cc3 100644 --- a/lib/game/components/board.dart +++ b/lib/game/components/board.dart @@ -12,11 +12,14 @@ class Board extends Component { @override Future onLoad() async { + // TODO(allisonryan0002): add bottom group and flutter forest to pinball + // game directly. Then remove board. final bottomGroup = _BottomGroup(); final flutterForest = FlutterForest(); // TODO(alestiago): adjust positioning to real design. + // TODO(alestiago): add dino in pinball game. final dino = ChromeDino() ..initialPosition = Vector2( BoardDimensions.bounds.center.dx + 25, @@ -74,7 +77,7 @@ class _BottomGroupSide extends Component { final flipper = ControlledFlipper( side: _side, - )..initialPosition = Vector2((11.0 * direction) + centerXAdjustment, -42.4); + )..initialPosition = Vector2((11.8 * direction) + centerXAdjustment, -43.6); final baseboard = Baseboard(side: _side) ..initialPosition = Vector2( (25.58 * direction) + centerXAdjustment, diff --git a/packages/pinball_components/lib/src/components/flipper.dart b/packages/pinball_components/lib/src/components/flipper.dart index 7e48366b..c9580510 100644 --- a/packages/pinball_components/lib/src/components/flipper.dart +++ b/packages/pinball_components/lib/src/components/flipper.dart @@ -1,5 +1,4 @@ import 'dart:async'; -import 'dart:math' as math; import 'package:flame/components.dart'; import 'package:flame_forge2d/flame_forge2d.dart'; @@ -198,8 +197,8 @@ class _FlipperJoint extends RevoluteJoint { lock(); } - /// The total angle of the arc motion. - static const _sweepingAngle = math.pi / 3.5; + /// Half the angle of the arc motion. + static const _halfSweepingAngle = 0.611; final BoardSide side; @@ -208,7 +207,7 @@ class _FlipperJoint extends RevoluteJoint { /// The joint is locked when initialized in order to force the [Flipper] /// at its resting position. void lock() { - const angle = _sweepingAngle / 2; + const angle = _halfSweepingAngle; setLimits( -angle * side.direction, -angle * side.direction, @@ -217,7 +216,7 @@ class _FlipperJoint extends RevoluteJoint { /// Unlocks the [Flipper] from its resting position. void unlock() { - const angle = _sweepingAngle / 2; + const angle = _halfSweepingAngle; setLimits(-angle, angle); } }