refactor: renamed RenderPriority to ZIndexes

pull/282/head
alestiago 3 years ago
parent 7555bfe1a2
commit c5cb750625

@ -18,7 +18,7 @@ class BottomGroup extends Component with ZIndex {
_BottomGroupSide(side: BoardSide.left), _BottomGroupSide(side: BoardSide.left),
], ],
) { ) {
zIndex = RenderPriority.bottomGroup; zIndex = ZIndexes.bottomGroup;
} }
} }

@ -20,7 +20,7 @@ class ControlledBall extends Ball with Controls<BallController> {
}) : super(baseColor: characterTheme.ballColor) { }) : super(baseColor: characterTheme.ballColor) {
controller = BallController(this); controller = BallController(this);
layer = Layer.launcher; layer = Layer.launcher;
zIndex = RenderPriority.ballOnLaunchRamp; zIndex = ZIndexes.ballOnLaunchRamp;
} }
/// {@template bonus_ball} /// {@template bonus_ball}
@ -30,13 +30,13 @@ class ControlledBall extends Ball with Controls<BallController> {
required CharacterTheme characterTheme, required CharacterTheme characterTheme,
}) : super(baseColor: characterTheme.ballColor) { }) : super(baseColor: characterTheme.ballColor) {
controller = BallController(this); controller = BallController(this);
zIndex = RenderPriority.ballOnBoard; zIndex = ZIndexes.ballOnBoard;
} }
/// [Ball] used in [DebugPinballGame]. /// [Ball] used in [DebugPinballGame].
ControlledBall.debug() : super(baseColor: const Color(0xFFFF0000)) { ControlledBall.debug() : super(baseColor: const Color(0xFFFF0000)) {
controller = BallController(this); controller = BallController(this);
zIndex = RenderPriority.ballOnBoard; zIndex = ZIndexes.ballOnBoard;
} }
} }

@ -40,7 +40,7 @@ class FlutterForest extends Component with ZIndex {
FlutterForestBonusBehavior(), FlutterForestBonusBehavior(),
], ],
) { ) {
zIndex = RenderPriority.flutterForest; zIndex = ZIndexes.flutterForest;
} }
/// Creates a [FlutterForest] without any children. /// Creates a [FlutterForest] without any children.

@ -41,7 +41,7 @@ class GoogleWord extends Component with ZIndex {
GoogleWordBonusBehavior(), GoogleWordBonusBehavior(),
], ],
) { ) {
zIndex = RenderPriority.decal; zIndex = ZIndexes.decal;
} }
/// Creates a [GoogleWord] without any children. /// Creates a [GoogleWord] without any children.

@ -36,7 +36,7 @@ class Multipliers extends Component with ZIndex {
MultipliersBehavior(), MultipliersBehavior(),
], ],
) { ) {
zIndex = RenderPriority.decal; zIndex = ZIndexes.decal;
} }
/// Creates [Multipliers] without any children. /// Creates [Multipliers] without any children.

@ -209,7 +209,7 @@ class _DebugGameBallsController extends _GameBallsController {
// TODO(wolfenrain): investigate this CI failure. // TODO(wolfenrain): investigate this CI failure.
// coverage:ignore-start // coverage:ignore-start
class _DebugInformation extends Component with HasGameRef<DebugPinballGame> { class _DebugInformation extends Component with HasGameRef<DebugPinballGame> {
_DebugInformation() : super(priority: RenderPriority.debugInfo); _DebugInformation() : super(priority: ZIndexes.debugInfo);
@override @override
PositionType get positionType => PositionType.widget; PositionType get positionType => PositionType.widget;

@ -38,7 +38,7 @@ class AndroidBumper extends BodyComponent with InitialPosition, ZIndex {
...?children, ...?children,
], ],
) { ) {
zIndex = RenderPriority.androidBumper; zIndex = ZIndexes.androidBumper;
} }
/// {@macro android_bumper} /// {@macro android_bumper}

@ -19,11 +19,11 @@ class AndroidSpaceship extends Component {
_AndroidHead()..initialPosition = position + Vector2(0.5, 0.25), _AndroidHead()..initialPosition = position + Vector2(0.5, 0.25),
_SpaceshipHole( _SpaceshipHole(
outsideLayer: Layer.spaceshipExitRail, outsideLayer: Layer.spaceshipExitRail,
outsidePriority: RenderPriority.ballOnSpaceshipRail, outsidePriority: ZIndexes.ballOnSpaceshipRail,
)..initialPosition = position - Vector2(5.3, -5.4), )..initialPosition = position - Vector2(5.3, -5.4),
_SpaceshipHole( _SpaceshipHole(
outsideLayer: Layer.board, outsideLayer: Layer.board,
outsidePriority: RenderPriority.ballOnBoard, outsidePriority: ZIndexes.ballOnBoard,
)..initialPosition = position - Vector2(-7.5, -1.1), )..initialPosition = position - Vector2(-7.5, -1.1),
], ],
); );
@ -70,7 +70,7 @@ class _SpaceshipSaucerSpriteAnimationComponent extends SpriteAnimationComponent
: super( : super(
anchor: Anchor.center, anchor: Anchor.center,
) { ) {
zIndex = RenderPriority.spaceshipSaucer; zIndex = ZIndexes.spaceshipSaucer;
} }
@override @override
@ -108,7 +108,7 @@ class _LightBeamSpriteComponent extends SpriteComponent
: super( : super(
anchor: Anchor.center, anchor: Anchor.center,
) { ) {
zIndex = RenderPriority.spaceshipLightBeam; zIndex = ZIndexes.spaceshipLightBeam;
} }
@override @override
@ -131,7 +131,7 @@ class _AndroidHead extends BodyComponent with InitialPosition, Layered, ZIndex {
renderBody: false, renderBody: false,
) { ) {
layer = Layer.spaceship; layer = Layer.spaceship;
zIndex = RenderPriority.androidHead; zIndex = ZIndexes.androidHead;
} }
@override @override
@ -194,7 +194,7 @@ class _SpaceshipHole extends LayerSensor {
insideLayer: Layer.spaceship, insideLayer: Layer.spaceship,
outsideLayer: outsideLayer, outsideLayer: outsideLayer,
orientation: LayerEntranceOrientation.down, orientation: LayerEntranceOrientation.down,
insideZIndex: RenderPriority.ballOnSpaceship, insideZIndex: ZIndexes.ballOnSpaceship,
outsideZIndex: outsidePriority, outsideZIndex: outsidePriority,
) { ) {
layer = Layer.spaceship; layer = Layer.spaceship;

@ -140,7 +140,7 @@ class _TurboChargeSpriteAnimationComponent extends SpriteAnimationComponent
anchor: const Anchor(0.53, 0.72), anchor: const Anchor(0.53, 0.72),
removeOnFinish: true, removeOnFinish: true,
) { ) {
zIndex = RenderPriority.turboChargeFlame; zIndex = ZIndexes.turboChargeFlame;
} }
late final Vector2 _textureSize; late final Vector2 _textureSize;

@ -11,7 +11,7 @@ class BoardBackgroundSpriteComponent extends SpriteComponent
anchor: Anchor.center, anchor: Anchor.center,
position: Vector2(0, -1), position: Vector2(0, -1),
) { ) {
zIndex = RenderPriority.boardBackground; zIndex = ZIndexes.boardBackground;
} }
@override @override

@ -29,7 +29,7 @@ class _BottomBoundary extends BodyComponent with InitialPosition, ZIndex {
renderBody: false, renderBody: false,
children: [_BottomBoundarySpriteComponent()], children: [_BottomBoundarySpriteComponent()],
) { ) {
zIndex = RenderPriority.bottomBoundary; zIndex = ZIndexes.bottomBoundary;
} }
List<FixtureDef> _createFixtureDefs() { List<FixtureDef> _createFixtureDefs() {
@ -97,7 +97,7 @@ class _OuterBoundary extends BodyComponent with InitialPosition, ZIndex {
renderBody: false, renderBody: false,
children: [_OuterBoundarySpriteComponent()], children: [_OuterBoundarySpriteComponent()],
) { ) {
zIndex = RenderPriority.outerBoundary; zIndex = ZIndexes.outerBoundary;
} }
List<FixtureDef> _createFixtureDefs() { List<FixtureDef> _createFixtureDefs() {
@ -199,7 +199,7 @@ class _OuterBottomBoundarySpriteComponent extends SpriteComponent
anchor: Anchor.center, anchor: Anchor.center,
position: Vector2(0, 71), position: Vector2(0, 71),
) { ) {
zIndex = RenderPriority.outerBottomBoundary; zIndex = ZIndexes.outerBottomBoundary;
} }
@override @override

@ -17,7 +17,7 @@ class ChromeDino extends BodyComponent with InitialPosition, ZIndex {
: super( : super(
renderBody: false, renderBody: false,
) { ) {
zIndex = RenderPriority.dino; zIndex = ZIndexes.dino;
} }
/// The size of the dinosaur mouth. /// The size of the dinosaur mouth.

@ -23,7 +23,6 @@ export 'layer.dart';
export 'layer_sensor.dart'; export 'layer_sensor.dart';
export 'multiplier/multiplier.dart'; export 'multiplier/multiplier.dart';
export 'plunger.dart'; export 'plunger.dart';
export 'render_priority.dart';
export 'rocket.dart'; export 'rocket.dart';
export 'score_text.dart'; export 'score_text.dart';
export 'shapes/shapes.dart'; export 'shapes/shapes.dart';
@ -34,3 +33,4 @@ export 'spaceship_ramp.dart';
export 'sparky_animatronic.dart'; export 'sparky_animatronic.dart';
export 'sparky_bumper/sparky_bumper.dart'; export 'sparky_bumper/sparky_bumper.dart';
export 'sparky_computer.dart'; export 'sparky_computer.dart';
export 'z_indexes.dart';

@ -30,7 +30,7 @@ class _DinoTopWall extends BodyComponent with InitialPosition, ZIndex {
children: [_DinoTopWallSpriteComponent()], children: [_DinoTopWallSpriteComponent()],
renderBody: false, renderBody: false,
) { ) {
zIndex = RenderPriority.dinoTopWall; zIndex = ZIndexes.dinoTopWall;
} }
List<FixtureDef> _createFixtureDefs() { List<FixtureDef> _createFixtureDefs() {
@ -124,7 +124,7 @@ class _DinoBottomWall extends BodyComponent with InitialPosition, ZIndex {
children: [_DinoBottomWallSpriteComponent()], children: [_DinoBottomWallSpriteComponent()],
renderBody: false, renderBody: false,
) { ) {
zIndex = RenderPriority.dinoBottomWall; zIndex = ZIndexes.dinoBottomWall;
} }
List<FixtureDef> _createFixtureDefs() { List<FixtureDef> _createFixtureDefs() {

@ -32,7 +32,7 @@ class _LaunchRampBase extends BodyComponent with Layered, ZIndex {
_LaunchRampBaseSpriteComponent(), _LaunchRampBaseSpriteComponent(),
], ],
) { ) {
zIndex = RenderPriority.launchRamp; zIndex = ZIndexes.launchRamp;
layer = Layer.launcher; layer = Layer.launcher;
} }
@ -141,7 +141,7 @@ class _LaunchRampForegroundRailing extends BodyComponent with ZIndex {
children: [_LaunchRampForegroundRailingSpriteComponent()], children: [_LaunchRampForegroundRailingSpriteComponent()],
renderBody: false, renderBody: false,
) { ) {
zIndex = RenderPriority.launchRampForegroundRailing; zIndex = ZIndexes.launchRampForegroundRailing;
} }
List<FixtureDef> _createFixtureDefs() { List<FixtureDef> _createFixtureDefs() {
@ -230,8 +230,8 @@ class _LaunchRampExit extends LayerSensor {
insideLayer: Layer.launcher, insideLayer: Layer.launcher,
outsideLayer: Layer.board, outsideLayer: Layer.board,
orientation: LayerEntranceOrientation.down, orientation: LayerEntranceOrientation.down,
insideZIndex: RenderPriority.ballOnLaunchRamp, insideZIndex: ZIndexes.ballOnLaunchRamp,
outsideZIndex: RenderPriority.ballOnBoard, outsideZIndex: ZIndexes.ballOnBoard,
) { ) {
layer = Layer.launcher; layer = Layer.launcher;
} }

@ -18,7 +18,7 @@ enum LayerEntranceOrientation {
/// [BodyComponent] located at the entrance and exit of a [Layer]. /// [BodyComponent] located at the entrance and exit of a [Layer].
/// ///
/// By default the base [layer] is set to [Layer.board] and the /// By default the base [layer] is set to [Layer.board] and the
/// [_outsideZIndex] is set to [RenderPriority.ballOnBoard]. /// [_outsideZIndex] is set to [ZIndexes.ballOnBoard].
/// {@endtemplate} /// {@endtemplate}
abstract class LayerSensor extends BodyComponent abstract class LayerSensor extends BodyComponent
with InitialPosition, Layered, ContactCallbacks { with InitialPosition, Layered, ContactCallbacks {
@ -32,7 +32,7 @@ abstract class LayerSensor extends BodyComponent
}) : _insideLayer = insideLayer, }) : _insideLayer = insideLayer,
_outsideLayer = outsideLayer ?? Layer.board, _outsideLayer = outsideLayer ?? Layer.board,
_insideZIndex = insideZIndex, _insideZIndex = insideZIndex,
_outsideZIndex = outsideZIndex ?? RenderPriority.ballOnBoard, _outsideZIndex = outsideZIndex ?? ZIndexes.ballOnBoard,
super(renderBody: false) { super(renderBody: false) {
layer = Layer.opening; layer = Layer.opening;
} }

@ -14,7 +14,7 @@ class Plunger extends BodyComponent with InitialPosition, Layered, ZIndex {
Plunger({ Plunger({
required this.compressionDistance, required this.compressionDistance,
}) : super(renderBody: false) { }) : super(renderBody: false) {
zIndex = RenderPriority.plunger; zIndex = ZIndexes.plunger;
layer = Layer.launcher; layer = Layer.launcher;
} }

@ -9,7 +9,7 @@ import 'package:pinball_flame/pinball_flame.dart';
class RocketSpriteComponent extends SpriteComponent with HasGameRef, ZIndex { class RocketSpriteComponent extends SpriteComponent with HasGameRef, ZIndex {
/// {@macro rocket_sprite_component} /// {@macro rocket_sprite_component}
RocketSpriteComponent() : super(anchor: Anchor.center) { RocketSpriteComponent() : super(anchor: Anchor.center) {
zIndex = RenderPriority.rocket; zIndex = ZIndexes.rocket;
} }
@override @override

@ -20,7 +20,7 @@ class ScoreText extends TextComponent with ZIndex {
position: position, position: position,
anchor: Anchor.center, anchor: Anchor.center,
) { ) {
zIndex = RenderPriority.scoreText; zIndex = ZIndexes.scoreText;
} }
late final Effect _effect; late final Effect _effect;

@ -23,7 +23,7 @@ class Slingshots extends Component with ZIndex {
)..initialPosition = Vector2(24.7, 6.2), )..initialPosition = Vector2(24.7, 6.2),
], ],
) { ) {
zIndex = RenderPriority.slingshots; zIndex = ZIndexes.slingshots;
} }
} }

@ -27,7 +27,7 @@ class _SpaceshipRail extends BodyComponent with Layered, ZIndex {
renderBody: false, renderBody: false,
) { ) {
layer = Layer.spaceshipExitRail; layer = Layer.spaceshipExitRail;
zIndex = RenderPriority.spaceshipRail; zIndex = ZIndexes.spaceshipRail;
} }
List<FixtureDef> _createFixtureDefs() { List<FixtureDef> _createFixtureDefs() {
@ -131,7 +131,7 @@ class _SpaceshipRailExitSpriteComponent extends SpriteComponent
anchor: Anchor.center, anchor: Anchor.center,
position: Vector2(-28, 19.4), position: Vector2(-28, 19.4),
) { ) {
zIndex = RenderPriority.spaceshipRailExit; zIndex = ZIndexes.spaceshipRailExit;
} }
@override @override
@ -153,7 +153,7 @@ class _SpaceshipRailExit extends LayerSensor {
: super( : super(
orientation: LayerEntranceOrientation.down, orientation: LayerEntranceOrientation.down,
insideLayer: Layer.spaceshipExitRail, insideLayer: Layer.spaceshipExitRail,
insideZIndex: RenderPriority.ballOnSpaceshipRail, insideZIndex: ZIndexes.ballOnSpaceshipRail,
) { ) {
layer = Layer.spaceshipExitRail; layer = Layer.spaceshipExitRail;
} }

@ -16,14 +16,14 @@ class SpaceshipRamp extends Component {
: super( : super(
children: [ children: [
_SpaceshipRampOpening( _SpaceshipRampOpening(
outsidePriority: RenderPriority.ballOnBoard, outsidePriority: ZIndexes.ballOnBoard,
rotation: math.pi, rotation: math.pi,
) )
..initialPosition = Vector2(1.7, -19.8) ..initialPosition = Vector2(1.7, -19.8)
..layer = Layer.opening, ..layer = Layer.opening,
_SpaceshipRampOpening( _SpaceshipRampOpening(
outsideLayer: Layer.spaceship, outsideLayer: Layer.spaceship,
outsidePriority: RenderPriority.ballOnSpaceship, outsidePriority: ZIndexes.ballOnSpaceship,
rotation: math.pi, rotation: math.pi,
) )
..initialPosition = Vector2(-13.7, -18.6) ..initialPosition = Vector2(-13.7, -18.6)
@ -101,7 +101,7 @@ class _SpaceshipRampBackground extends BodyComponent
], ],
) { ) {
layer = Layer.spaceshipEntranceRamp; layer = Layer.spaceshipEntranceRamp;
zIndex = RenderPriority.spaceshipRamp; zIndex = ZIndexes.spaceshipRamp;
} }
/// Width between walls of the ramp. /// Width between walls of the ramp.
@ -152,7 +152,7 @@ class _SpaceshipRampBackgroundRailingSpriteComponent extends SpriteComponent
anchor: Anchor.center, anchor: Anchor.center,
position: Vector2(-11.7, -54.3), position: Vector2(-11.7, -54.3),
) { ) {
zIndex = RenderPriority.spaceshipRampBackgroundRailing; zIndex = ZIndexes.spaceshipRampBackgroundRailing;
} }
@override @override
@ -203,7 +203,7 @@ class _SpaceshipRampArrowSpriteComponent
anchor: Anchor.center, anchor: Anchor.center,
position: Vector2(-3.9, -56.5), position: Vector2(-3.9, -56.5),
) { ) {
zIndex = RenderPriority.spaceshipRampArrow; zIndex = ZIndexes.spaceshipRampArrow;
} }
/// Changes arrow image to the next [Sprite]. /// Changes arrow image to the next [Sprite].
@ -228,7 +228,7 @@ class _SpaceshipRampArrowSpriteComponent
class _SpaceshipRampBoardOpeningSpriteComponent extends SpriteComponent class _SpaceshipRampBoardOpeningSpriteComponent extends SpriteComponent
with HasGameRef, ZIndex { with HasGameRef, ZIndex {
_SpaceshipRampBoardOpeningSpriteComponent() : super(anchor: Anchor.center) { _SpaceshipRampBoardOpeningSpriteComponent() : super(anchor: Anchor.center) {
zIndex = RenderPriority.spaceshipRampBoardOpening; zIndex = ZIndexes.spaceshipRampBoardOpening;
} }
@override @override
@ -252,7 +252,7 @@ class _SpaceshipRampForegroundRailing extends BodyComponent
children: [_SpaceshipRampForegroundRailingSpriteComponent()], children: [_SpaceshipRampForegroundRailingSpriteComponent()],
) { ) {
layer = Layer.spaceshipEntranceRamp; layer = Layer.spaceshipEntranceRamp;
zIndex = RenderPriority.spaceshipRampForegroundRailing; zIndex = ZIndexes.spaceshipRampForegroundRailing;
} }
List<FixtureDef> _createFixtureDefs() { List<FixtureDef> _createFixtureDefs() {
@ -354,7 +354,7 @@ class _SpaceshipRampOpening extends LayerSensor {
insideLayer: Layer.spaceshipEntranceRamp, insideLayer: Layer.spaceshipEntranceRamp,
outsideLayer: outsideLayer, outsideLayer: outsideLayer,
orientation: LayerEntranceOrientation.down, orientation: LayerEntranceOrientation.down,
insideZIndex: RenderPriority.ballOnSpaceshipRamp, insideZIndex: ZIndexes.ballOnSpaceshipRamp,
outsideZIndex: outsidePriority, outsideZIndex: outsidePriority,
); );

@ -13,7 +13,7 @@ class SparkyAnimatronic extends SpriteAnimationComponent
anchor: Anchor.center, anchor: Anchor.center,
playing: false, playing: false,
) { ) {
zIndex = RenderPriority.sparkyAnimatronic; zIndex = ZIndexes.sparkyAnimatronic;
} }
@override @override

@ -38,7 +38,7 @@ class SparkyBumper extends BodyComponent with InitialPosition, ZIndex {
...?children, ...?children,
], ],
) { ) {
zIndex = RenderPriority.sparkyBumper; zIndex = ZIndexes.sparkyBumper;
} }
/// {@macro sparky_bumper} /// {@macro sparky_bumper}

@ -26,7 +26,7 @@ class _ComputerBase extends BodyComponent with InitialPosition, ZIndex {
renderBody: false, renderBody: false,
children: [_ComputerBaseSpriteComponent()], children: [_ComputerBaseSpriteComponent()],
) { ) {
zIndex = RenderPriority.computerBase; zIndex = ZIndexes.computerBase;
} }
List<FixtureDef> _createFixtureDefs() { List<FixtureDef> _createFixtureDefs() {
@ -91,7 +91,7 @@ class _ComputerTopSpriteComponent extends SpriteComponent
anchor: Anchor.center, anchor: Anchor.center,
position: Vector2(-12.52, -49.37), position: Vector2(-12.52, -49.37),
) { ) {
zIndex = RenderPriority.computerTop; zIndex = ZIndexes.computerTop;
} }
@override @override
@ -115,7 +115,7 @@ class _ComputerGlowSpriteComponent extends SpriteComponent
anchor: Anchor.center, anchor: Anchor.center,
position: Vector2(7.4, 10), position: Vector2(7.4, 10),
) { ) {
zIndex = RenderPriority.computerGlow; zIndex = ZIndexes.computerGlow;
} }
@override @override

@ -1,31 +1,22 @@
// ignore_for_file: public_member_api_docs // ignore_for_file: public_member_api_docs
import 'package:pinball_components/pinball_components.dart'; /// Z-Indexes for the component rendering order in the pinball game.
/// {@template render_priority}
/// Priorities for the component rendering order in the pinball game.
/// {@endtemplate}
// TODO(allisonryan0002): find alternative to section comments. // TODO(allisonryan0002): find alternative to section comments.
abstract class RenderPriority { abstract class ZIndexes {
static const _base = 0; static const _base = 0;
static const _above = 1; static const _above = 1;
static const _below = -1; static const _below = -1;
// Ball // Ball
/// Render priority for the [Ball] while it's on the board.
static const ballOnBoard = _base; static const ballOnBoard = _base;
/// Render priority for the [Ball] while it's on the [SpaceshipRamp].
static const ballOnSpaceshipRamp = _above + spaceshipRampBackgroundRailing; static const ballOnSpaceshipRamp = _above + spaceshipRampBackgroundRailing;
/// Render priority for the [Ball] while it's on the [AndroidSpaceship].
static const ballOnSpaceship = _above + spaceshipSaucer; static const ballOnSpaceship = _above + spaceshipSaucer;
/// Render priority for the [Ball] while it's on the [SpaceshipRail].
static const ballOnSpaceshipRail = _above + spaceshipRail; static const ballOnSpaceshipRail = _above + spaceshipRail;
/// Render priority for the [Ball] while it's on the [LaunchRamp].
static const ballOnLaunchRamp = _above + launchRamp; static const ballOnLaunchRamp = _above + launchRamp;
// Background // Background

@ -7,7 +7,7 @@ import 'package:sandbox/stories/ball/basic_ball_game.dart';
class AndroidSpaceshipGame extends BallGame { class AndroidSpaceshipGame extends BallGame {
AndroidSpaceshipGame() AndroidSpaceshipGame()
: super( : super(
ballPriority: RenderPriority.ballOnSpaceship, ballPriority: ZIndexes.ballOnSpaceship,
ballLayer: Layer.spaceship, ballLayer: Layer.spaceship,
imagesFileNames: [ imagesFileNames: [
Assets.images.android.spaceship.saucer.keyName, Assets.images.android.spaceship.saucer.keyName,

@ -9,7 +9,7 @@ class SpaceshipRailGame extends BallGame {
SpaceshipRailGame() SpaceshipRailGame()
: super( : super(
color: Colors.blue, color: Colors.blue,
ballPriority: RenderPriority.ballOnSpaceshipRail, ballPriority: ZIndexes.ballOnSpaceshipRail,
ballLayer: Layer.spaceshipExitRail, ballLayer: Layer.spaceshipExitRail,
imagesFileNames: [ imagesFileNames: [
Assets.images.android.rail.main.keyName, Assets.images.android.rail.main.keyName,

@ -10,7 +10,7 @@ class SpaceshipRampGame extends BallGame with KeyboardEvents {
SpaceshipRampGame() SpaceshipRampGame()
: super( : super(
color: Colors.blue, color: Colors.blue,
ballPriority: RenderPriority.ballOnSpaceshipRamp, ballPriority: ZIndexes.ballOnSpaceshipRamp,
ballLayer: Layer.spaceshipEntranceRamp, ballLayer: Layer.spaceshipEntranceRamp,
imagesFileNames: [ imagesFileNames: [
Assets.images.android.ramp.railingBackground.keyName, Assets.images.android.ramp.railingBackground.keyName,

@ -9,7 +9,7 @@ class LaunchRampGame extends BallGame {
LaunchRampGame() LaunchRampGame()
: super( : super(
color: Colors.blue, color: Colors.blue,
ballPriority: RenderPriority.ballOnLaunchRamp, ballPriority: ZIndexes.ballOnLaunchRamp,
ballLayer: Layer.launcher, ballLayer: Layer.launcher,
); );

@ -145,7 +145,7 @@ void main() {
sensor.beginContact(ball, MockContact()); sensor.beginContact(ball, MockContact());
verify(() => ball.layer = Layer.board); verify(() => ball.layer = Layer.board);
verify(() => ball.zIndex = RenderPriority.ballOnBoard).called(1); verify(() => ball.zIndex = ZIndexes.ballOnBoard).called(1);
}); });
flameTester.test( flameTester.test(
@ -168,7 +168,7 @@ void main() {
sensor.beginContact(ball, MockContact()); sensor.beginContact(ball, MockContact());
verify(() => ball.layer = Layer.board); verify(() => ball.layer = Layer.board);
verify(() => ball.zIndex = RenderPriority.ballOnBoard).called(1); verify(() => ball.zIndex = ZIndexes.ballOnBoard).called(1);
}); });
}); });
} }

Loading…
Cancel
Save