diff --git a/lib/game/components/jetpack_ramp.dart b/lib/game/components/jetpack_ramp.dart index 63b6bf75..fe1096dd 100644 --- a/lib/game/components/jetpack_ramp.dart +++ b/lib/game/components/jetpack_ramp.dart @@ -11,12 +11,6 @@ import 'package:pinball_components/pinball_components.dart'; /// A [Blueprint] which creates the [JetpackRamp]. class Jetpack extends Forge2DBlueprint { - /// Width between walls of the pathway. - static const width = 5.0; - - /// Size for the radius of the external wall pathway. - static const externalRadius = 18.0; - @override void build(_) { final position = Vector2( @@ -63,12 +57,18 @@ class JetpackRamp extends BodyComponent with InitialPosition, Layered { ..style = PaintingStyle.stroke; } + /// Size for the radius of the external wall pathway. + static const _externalRadius = 18.0; + + /// Width between walls of the pathway. + static const width = 5.0; + List _createFixtureDefs() { final fixturesDef = []; final externalCurveShape = ArcShape( center: initialPosition, - arcRadius: Jetpack.externalRadius, + arcRadius: _externalRadius, angle: math.pi, rotation: math.pi, ); @@ -76,7 +76,7 @@ class JetpackRamp extends BodyComponent with InitialPosition, Layered { fixturesDef.add(externalFixtureDef); final internalCurveShape = externalCurveShape.copyWith( - arcRadius: Jetpack.externalRadius - Jetpack.width, + arcRadius: _externalRadius - width, ); final internalFixtureDef = FixtureDef(internalCurveShape); fixturesDef.add(internalFixtureDef); @@ -115,7 +115,7 @@ class _JetpackRampOpening extends RampOpening { final double _rotation; - static final Vector2 _size = Vector2(Jetpack.width / 3, .1); + static final Vector2 _size = Vector2(JetpackRamp.width / 3, .1); @override Shape get shape => PolygonShape() diff --git a/lib/game/components/launcher_ramp.dart b/lib/game/components/launcher_ramp.dart index 99fc4114..c90a23c8 100644 --- a/lib/game/components/launcher_ramp.dart +++ b/lib/game/components/launcher_ramp.dart @@ -11,12 +11,6 @@ import 'package:pinball_components/pinball_components.dart'; /// A [Blueprint] which creates the [LauncherRamp]. class Launcher extends Forge2DBlueprint { - /// Width between walls of the pathway. - static const width = 5.0; - - /// Size for the radius of the external wall pathway. - static const externalRadius = 16.3; - @override void build(_) { final position = Vector2( @@ -60,6 +54,12 @@ class LauncherRamp extends BodyComponent with InitialPosition, Layered { ..style = PaintingStyle.stroke; } + /// Width between walls of the pathway. + static const width = 5.0; + + /// Size for the radius of the external wall pathway. + static const _externalRadius = 16.3; + List _createFixtureDefs() { final fixturesDef = []; @@ -76,15 +76,15 @@ class LauncherRamp extends BodyComponent with InitialPosition, Layered { final internalStraightShape = EdgeShape() ..set( - startPosition - Vector2(Launcher.width, 0), - endPosition - Vector2(Launcher.width, 0), + startPosition - Vector2(width, 0), + endPosition - Vector2(width, 0), ); final internalStraightFixtureDef = FixtureDef(internalStraightShape); fixturesDef.add(internalStraightFixtureDef); final externalCurveShape = ArcShape( center: initialPosition + Vector2(-28.2, 132), - arcRadius: Launcher.externalRadius, + arcRadius: _externalRadius, angle: math.pi / 2, rotation: 3 * math.pi / 2, ); @@ -92,7 +92,7 @@ class LauncherRamp extends BodyComponent with InitialPosition, Layered { fixturesDef.add(externalCurveFixtureDef); final internalCurveShape = externalCurveShape.copyWith( - arcRadius: Launcher.externalRadius - Launcher.width, + arcRadius: _externalRadius - width, ); final internalCurveFixtureDef = FixtureDef(internalCurveShape); fixturesDef.add(internalCurveFixtureDef); @@ -129,7 +129,7 @@ class _LauncherRampOpening extends RampOpening { final double _rotation; - static final Vector2 _size = Vector2(Launcher.width / 3, .1); + static final Vector2 _size = Vector2(LauncherRamp.width / 3, .1); @override Shape get shape => PolygonShape()