|
|
|
@ -27,33 +27,30 @@ class LauncherRamp extends Component with HasGameRef<PinballGame> {
|
|
|
|
|
RampOpeningBallContactCallback<_LauncherRampOpening>(),
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
final launcherRampRotation =
|
|
|
|
|
-math.atan(18.6 / PinballGame.boardBounds.height);
|
|
|
|
|
|
|
|
|
|
final straightPath = Pathway.straight(
|
|
|
|
|
color: const Color.fromARGB(255, 34, 255, 0),
|
|
|
|
|
start: position + Vector2(-1.2, 10),
|
|
|
|
|
end: position + Vector2(-1.2, 117),
|
|
|
|
|
width: 5,
|
|
|
|
|
rotation: launcherRampRotation,
|
|
|
|
|
start: position + Vector2(-4.5, -10),
|
|
|
|
|
end: position + Vector2(-4.5, 117),
|
|
|
|
|
width: 4,
|
|
|
|
|
rotation: PinballGame.boardPerspectiveAngle,
|
|
|
|
|
)
|
|
|
|
|
..initialPosition = position
|
|
|
|
|
..layer = layer;
|
|
|
|
|
|
|
|
|
|
final curvedPath = Pathway.arc(
|
|
|
|
|
color: const Color.fromARGB(255, 251, 255, 0),
|
|
|
|
|
center: position + Vector2(-2.8, 87.2),
|
|
|
|
|
center: position + Vector2(-7, 87.2),
|
|
|
|
|
radius: 16.3,
|
|
|
|
|
angle: math.pi / 2,
|
|
|
|
|
width: 5,
|
|
|
|
|
width: 4,
|
|
|
|
|
rotation: 3 * math.pi / 2,
|
|
|
|
|
)..layer = layer;
|
|
|
|
|
|
|
|
|
|
final leftOpening = _LauncherRampOpening(rotation: math.pi / 2)
|
|
|
|
|
..initialPosition = position + Vector2(-11.8, 66.3)
|
|
|
|
|
..initialPosition = position + Vector2(-13.8, 66.7)
|
|
|
|
|
..layer = Layer.opening;
|
|
|
|
|
final rightOpening = _LauncherRampOpening(rotation: 0)
|
|
|
|
|
..initialPosition = position + Vector2(-4.9, 59.4)
|
|
|
|
|
..initialPosition = position + Vector2(-6.8, 59.4)
|
|
|
|
|
..layer = Layer.opening;
|
|
|
|
|
|
|
|
|
|
await addAll([
|
|
|
|
@ -81,9 +78,9 @@ class _LauncherRampOpening extends RampOpening {
|
|
|
|
|
|
|
|
|
|
final double _rotation;
|
|
|
|
|
|
|
|
|
|
// TODO(ruialonso): Avoid magic number 3, should be propotional to
|
|
|
|
|
// TODO(ruialonso): Avoid magic number 2.5, should be propotional to
|
|
|
|
|
// [JetpackRamp].
|
|
|
|
|
static final Vector2 _size = Vector2(3, .1);
|
|
|
|
|
static final Vector2 _size = Vector2(2.5, .1);
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Shape get shape => PolygonShape()
|
|
|
|
|