|
|
@ -11,6 +11,9 @@ import 'package:pinball_components/pinball_components.dart';
|
|
|
|
/// [_LaunchRampForegroundRailing].
|
|
|
|
/// [_LaunchRampForegroundRailing].
|
|
|
|
/// {@endtemplate}
|
|
|
|
/// {@endtemplate}
|
|
|
|
class LaunchRamp extends Forge2DBlueprint {
|
|
|
|
class LaunchRamp extends Forge2DBlueprint {
|
|
|
|
|
|
|
|
/// Base priority for [Ball] while inside [LaunchRamp].
|
|
|
|
|
|
|
|
static const ballPriorityInsideRamp = -2;
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
void build(_) {
|
|
|
|
void build(_) {
|
|
|
|
addAllContactCallback([
|
|
|
|
addAllContactCallback([
|
|
|
@ -40,7 +43,7 @@ class LaunchRamp extends Forge2DBlueprint {
|
|
|
|
/// {@endtemplate}
|
|
|
|
/// {@endtemplate}
|
|
|
|
class _LaunchRampBase extends BodyComponent with InitialPosition, Layered {
|
|
|
|
class _LaunchRampBase extends BodyComponent with InitialPosition, Layered {
|
|
|
|
/// {@macro launch_ramp_base}
|
|
|
|
/// {@macro launch_ramp_base}
|
|
|
|
_LaunchRampBase() : super(priority: -1) {
|
|
|
|
_LaunchRampBase() : super(priority: LaunchRamp.ballPriorityInsideRamp - 1) {
|
|
|
|
layer = Layer.launcher;
|
|
|
|
layer = Layer.launcher;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -143,7 +146,8 @@ class _LaunchRampBaseSpriteComponent extends SpriteComponent with HasGameRef {
|
|
|
|
class _LaunchRampForegroundRailing extends BodyComponent
|
|
|
|
class _LaunchRampForegroundRailing extends BodyComponent
|
|
|
|
with InitialPosition, Layered {
|
|
|
|
with InitialPosition, Layered {
|
|
|
|
/// {@macro launch_ramp_foreground_railing}
|
|
|
|
/// {@macro launch_ramp_foreground_railing}
|
|
|
|
_LaunchRampForegroundRailing() : super(priority: 1) {
|
|
|
|
_LaunchRampForegroundRailing()
|
|
|
|
|
|
|
|
: super(priority: LaunchRamp.ballPriorityInsideRamp + 1) {
|
|
|
|
layer = Layer.launcher;
|
|
|
|
layer = Layer.launcher;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -227,7 +231,8 @@ class _LaunchRampExit extends RampOpening {
|
|
|
|
super(
|
|
|
|
super(
|
|
|
|
insideLayer: Layer.launcher,
|
|
|
|
insideLayer: Layer.launcher,
|
|
|
|
orientation: RampOrientation.down,
|
|
|
|
orientation: RampOrientation.down,
|
|
|
|
insidePriority: 3,
|
|
|
|
insidePriority: LaunchRamp.ballPriorityInsideRamp,
|
|
|
|
|
|
|
|
outsidePriority: 0,
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
final double _rotation;
|
|
|
|
final double _rotation;
|
|
|
|