|
|
@ -21,15 +21,14 @@ class SpaceshipRamp extends Forge2DBlueprint {
|
|
|
|
]);
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
|
|
final rightOpening = _SpaceshipRampOpening(
|
|
|
|
final rightOpening = _SpaceshipRampOpening(
|
|
|
|
// TODO(ruimiguel): set Board priority when defined.
|
|
|
|
outsidePriority: PinballPriority.ballOnBoard,
|
|
|
|
outsidePriority: 1,
|
|
|
|
|
|
|
|
rotation: math.pi,
|
|
|
|
rotation: math.pi,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
..initialPosition = Vector2(1.7, 19.8)
|
|
|
|
..initialPosition = Vector2(1.7, 19.8)
|
|
|
|
..layer = Layer.opening;
|
|
|
|
..layer = Layer.opening;
|
|
|
|
final leftOpening = _SpaceshipRampOpening(
|
|
|
|
final leftOpening = _SpaceshipRampOpening(
|
|
|
|
outsideLayer: Layer.spaceship,
|
|
|
|
outsideLayer: Layer.spaceship,
|
|
|
|
outsidePriority: Ball.spaceshipPriority,
|
|
|
|
outsidePriority: PinballPriority.ballOnSpaceship,
|
|
|
|
rotation: math.pi,
|
|
|
|
rotation: math.pi,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
..initialPosition = Vector2(-13.7, 18.6)
|
|
|
|
..initialPosition = Vector2(-13.7, 18.6)
|
|
|
@ -50,6 +49,7 @@ class SpaceshipRamp extends Forge2DBlueprint {
|
|
|
|
rightOpening,
|
|
|
|
rightOpening,
|
|
|
|
leftOpening,
|
|
|
|
leftOpening,
|
|
|
|
baseRight,
|
|
|
|
baseRight,
|
|
|
|
|
|
|
|
_SpaceshipRampBackgroundRailingSpriteComponent(),
|
|
|
|
spaceshipRamp,
|
|
|
|
spaceshipRamp,
|
|
|
|
spaceshipRampForegroundRailing,
|
|
|
|
spaceshipRampForegroundRailing,
|
|
|
|
]);
|
|
|
|
]);
|
|
|
@ -58,7 +58,7 @@ class SpaceshipRamp extends Forge2DBlueprint {
|
|
|
|
|
|
|
|
|
|
|
|
class _SpaceshipRampBackground extends BodyComponent
|
|
|
|
class _SpaceshipRampBackground extends BodyComponent
|
|
|
|
with InitialPosition, Layered {
|
|
|
|
with InitialPosition, Layered {
|
|
|
|
_SpaceshipRampBackground() : super(priority: Ball.spaceshipRampPriority - 1) {
|
|
|
|
_SpaceshipRampBackground() : super(priority: PinballPriority.spaceshipRamp) {
|
|
|
|
layer = Layer.spaceshipEntranceRamp;
|
|
|
|
layer = Layer.spaceshipEntranceRamp;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -119,12 +119,13 @@ class _SpaceshipRampBackground extends BodyComponent
|
|
|
|
renderBody = false;
|
|
|
|
renderBody = false;
|
|
|
|
|
|
|
|
|
|
|
|
await add(_SpaceshipRampBackgroundRampSpriteComponent());
|
|
|
|
await add(_SpaceshipRampBackgroundRampSpriteComponent());
|
|
|
|
await add(_SpaceshipRampBackgroundRailingSpriteComponent());
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class _SpaceshipRampBackgroundRailingSpriteComponent extends SpriteComponent
|
|
|
|
class _SpaceshipRampBackgroundRailingSpriteComponent extends SpriteComponent
|
|
|
|
with HasGameRef {
|
|
|
|
with HasGameRef {
|
|
|
|
|
|
|
|
_SpaceshipRampBackgroundRailingSpriteComponent()
|
|
|
|
|
|
|
|
: super(priority: PinballPriority.spaceshipRampBackgroundRailing);
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Future<void> onLoad() async {
|
|
|
|
Future<void> onLoad() async {
|
|
|
|
await super.onLoad();
|
|
|
|
await super.onLoad();
|
|
|
@ -170,7 +171,7 @@ class _SpaceshipRampBoardOpeningSpriteComponent extends SpriteComponent
|
|
|
|
class _SpaceshipRampForegroundRailing extends BodyComponent
|
|
|
|
class _SpaceshipRampForegroundRailing extends BodyComponent
|
|
|
|
with InitialPosition, Layered {
|
|
|
|
with InitialPosition, Layered {
|
|
|
|
_SpaceshipRampForegroundRailing()
|
|
|
|
_SpaceshipRampForegroundRailing()
|
|
|
|
: super(priority: Ball.spaceshipRampPriority + 1) {
|
|
|
|
: super(priority: PinballPriority.spaceshipRampForegroundRailing) {
|
|
|
|
layer = Layer.spaceshipEntranceRamp;
|
|
|
|
layer = Layer.spaceshipEntranceRamp;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -290,7 +291,7 @@ class _SpaceshipRampOpening extends RampOpening {
|
|
|
|
insideLayer: Layer.spaceshipEntranceRamp,
|
|
|
|
insideLayer: Layer.spaceshipEntranceRamp,
|
|
|
|
outsideLayer: outsideLayer,
|
|
|
|
outsideLayer: outsideLayer,
|
|
|
|
orientation: RampOrientation.down,
|
|
|
|
orientation: RampOrientation.down,
|
|
|
|
insidePriority: Ball.spaceshipRampPriority,
|
|
|
|
insidePriority: PinballPriority.ballOnSpaceshipRamp,
|
|
|
|
outsidePriority: outsidePriority,
|
|
|
|
outsidePriority: outsidePriority,
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
renderBody = false;
|
|
|
|
renderBody = false;
|
|
|
|