chore: rename priority class

pull/198/head
Allison Ryan 3 years ago
parent b16b5afcb1
commit 8ce61013cf

@ -42,7 +42,7 @@ class Board extends Component {
// TODO(alestiago): Consider renaming once entire Board is defined. // TODO(alestiago): Consider renaming once entire Board is defined.
class _BottomGroup extends Component { class _BottomGroup extends Component {
/// {@macro bottom_group} /// {@macro bottom_group}
_BottomGroup() : super(priority: PinballPriority.bottomGroup); _BottomGroup() : super(priority: RenderPriority.bottomGroup);
@override @override
Future<void> onLoad() async { Future<void> onLoad() async {

@ -18,7 +18,7 @@ class ControlledBall extends Ball with Controls<BallController> {
required PinballTheme theme, required PinballTheme theme,
}) : super(baseColor: theme.characterTheme.ballColor) { }) : super(baseColor: theme.characterTheme.ballColor) {
controller = BallController(this); controller = BallController(this);
priority = PinballPriority.ballOnLaunchRamp; priority = RenderPriority.ballOnLaunchRamp;
layer = Layer.launcher; layer = Layer.launcher;
} }
@ -31,13 +31,13 @@ class ControlledBall extends Ball with Controls<BallController> {
required PinballTheme theme, required PinballTheme theme,
}) : super(baseColor: theme.characterTheme.ballColor) { }) : super(baseColor: theme.characterTheme.ballColor) {
controller = BallController(this); controller = BallController(this);
priority = PinballPriority.ballOnBoard; priority = RenderPriority.ballOnBoard;
} }
/// [Ball] used in [DebugPinballGame]. /// [Ball] used in [DebugPinballGame].
ControlledBall.debug() : super(baseColor: const Color(0xFFFF0000)) { ControlledBall.debug() : super(baseColor: const Color(0xFFFF0000)) {
controller = DebugBallController(this); controller = DebugBallController(this);
priority = PinballPriority.ballOnBoard; priority = RenderPriority.ballOnBoard;
} }
} }

@ -165,7 +165,7 @@ class DebugPinballGame extends PinballGame with TapDetector {
anchor: Anchor.center, anchor: Anchor.center,
) )
..position = Vector2(0, -7.8) ..position = Vector2(0, -7.8)
..priority = PinballPriority.background; ..priority = RenderPriority.background;
await add(spriteComponent); await add(spriteComponent);
} }

@ -19,7 +19,7 @@ class AlienBumper extends BodyComponent with InitialPosition {
_activeAssetPath = activeAssetPath, _activeAssetPath = activeAssetPath,
_inactiveAssetPath = inactiveAssetPath, _inactiveAssetPath = inactiveAssetPath,
_spriteComponent = spriteComponent, _spriteComponent = spriteComponent,
super(priority: PinballPriority.alienBumper); super(priority: RenderPriority.alienBumper);
/// {@macro alien_bumper} /// {@macro alien_bumper}
AlienBumper.a() AlienBumper.a()

@ -23,7 +23,7 @@ class Boundaries extends Forge2DBlueprint {
/// {@endtemplate bottom_boundary} /// {@endtemplate bottom_boundary}
class _BottomBoundary extends BodyComponent with InitialPosition { class _BottomBoundary extends BodyComponent with InitialPosition {
/// {@macro bottom_boundary} /// {@macro bottom_boundary}
_BottomBoundary() : super(priority: PinballPriority.bottomBoundary); _BottomBoundary() : super(priority: RenderPriority.bottomBoundary);
List<FixtureDef> _createFixtureDefs() { List<FixtureDef> _createFixtureDefs() {
final fixturesDefs = <FixtureDef>[]; final fixturesDefs = <FixtureDef>[];
@ -88,7 +88,7 @@ class _BottomBoundarySpriteComponent extends SpriteComponent with HasGameRef {
/// {@endtemplate outer_boundary} /// {@endtemplate outer_boundary}
class _OuterBoundary extends BodyComponent with InitialPosition { class _OuterBoundary extends BodyComponent with InitialPosition {
/// {@macro outer_boundary} /// {@macro outer_boundary}
_OuterBoundary() : super(priority: PinballPriority.outerBoudary); _OuterBoundary() : super(priority: RenderPriority.outerBoudary);
List<FixtureDef> _createFixtureDefs() { List<FixtureDef> _createFixtureDefs() {
final fixturesDefs = <FixtureDef>[]; final fixturesDefs = <FixtureDef>[];

@ -16,7 +16,7 @@ class ChromeDino extends BodyComponent with InitialPosition {
: super( : super(
// TODO(alestiago): Remove once sprites are defined. // TODO(alestiago): Remove once sprites are defined.
paint: Paint()..color = Colors.blue, paint: Paint()..color = Colors.blue,
priority: PinballPriority.dino, priority: RenderPriority.dino,
); );
/// The size of the dinosaur mouth. /// The size of the dinosaur mouth.

@ -10,7 +10,7 @@ class DashAnimatronic extends SpriteAnimationComponent with HasGameRef {
: super( : super(
anchor: Anchor.center, anchor: Anchor.center,
playing: false, playing: false,
priority: PinballPriority.dashAnimatronic, priority: RenderPriority.dashAnimatronic,
); );
@override @override

@ -16,7 +16,7 @@ abstract class DashNestBumper extends BodyComponent with InitialPosition {
}) : _activeAssetPath = activeAssetPath, }) : _activeAssetPath = activeAssetPath,
_inactiveAssetPath = inactiveAssetPath, _inactiveAssetPath = inactiveAssetPath,
_spriteComponent = spriteComponent, _spriteComponent = spriteComponent,
super(priority: PinballPriority.dashBumper); super(priority: RenderPriority.dashBumper);
final String _activeAssetPath; final String _activeAssetPath;
late final Sprite _activeSprite; late final Sprite _activeSprite;

@ -28,7 +28,7 @@ class DinoWalls extends Forge2DBlueprint {
/// {@endtemplate} /// {@endtemplate}
class _DinoTopWall extends BodyComponent with InitialPosition { class _DinoTopWall extends BodyComponent with InitialPosition {
///{@macro dino_top_wall} ///{@macro dino_top_wall}
_DinoTopWall() : super(priority: PinballPriority.dinoTopWall); _DinoTopWall() : super(priority: RenderPriority.dinoTopWall);
List<FixtureDef> _createFixtureDefs() { List<FixtureDef> _createFixtureDefs() {
final fixturesDef = <FixtureDef>[]; final fixturesDef = <FixtureDef>[];
@ -124,7 +124,7 @@ class _DinoTopWallSpriteComponent extends SpriteComponent with HasGameRef {
/// {@endtemplate} /// {@endtemplate}
class _DinoBottomWall extends BodyComponent with InitialPosition { class _DinoBottomWall extends BodyComponent with InitialPosition {
///{@macro dino_top_wall} ///{@macro dino_top_wall}
_DinoBottomWall() : super(priority: PinballPriority.dinoBottomWall); _DinoBottomWall() : super(priority: RenderPriority.dinoBottomWall);
List<FixtureDef> _createFixtureDefs() { List<FixtureDef> _createFixtureDefs() {
final fixturesDef = <FixtureDef>[]; final fixturesDef = <FixtureDef>[];

@ -7,7 +7,7 @@ import 'package:pinball_components/pinball_components.dart';
/// {@endtemplate} /// {@endtemplate}
class FlutterSignPost extends BodyComponent with InitialPosition { class FlutterSignPost extends BodyComponent with InitialPosition {
/// {@macro flutter_sign_post} /// {@macro flutter_sign_post}
FlutterSignPost() : super(priority: PinballPriority.flutterSignPost); FlutterSignPost() : super(priority: RenderPriority.flutterSignPost);
@override @override
Future<void> onLoad() async { Future<void> onLoad() async {

@ -41,7 +41,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: PinballPriority.launchRamp) { _LaunchRampBase() : super(priority: RenderPriority.launchRamp) {
layer = Layer.launcher; layer = Layer.launcher;
} }
@ -144,7 +144,7 @@ class _LaunchRampBaseSpriteComponent extends SpriteComponent with HasGameRef {
class _LaunchRampForegroundRailing extends BodyComponent with InitialPosition { class _LaunchRampForegroundRailing extends BodyComponent with InitialPosition {
/// {@macro launch_ramp_foreground_railing} /// {@macro launch_ramp_foreground_railing}
_LaunchRampForegroundRailing() _LaunchRampForegroundRailing()
: super(priority: PinballPriority.launchRampForegroundRailing); : super(priority: RenderPriority.launchRampForegroundRailing);
List<FixtureDef> _createFixtureDefs() { List<FixtureDef> _createFixtureDefs() {
final fixturesDef = <FixtureDef>[]; final fixturesDef = <FixtureDef>[];
@ -247,8 +247,8 @@ class _LaunchRampExit extends RampOpening {
insideLayer: Layer.launcher, insideLayer: Layer.launcher,
outsideLayer: Layer.board, outsideLayer: Layer.board,
orientation: RampOrientation.down, orientation: RampOrientation.down,
insidePriority: PinballPriority.ballOnLaunchRamp, insidePriority: RenderPriority.ballOnLaunchRamp,
outsidePriority: PinballPriority.ballOnBoard, outsidePriority: RenderPriority.ballOnBoard,
) { ) {
layer = Layer.launcher; layer = Layer.launcher;
renderBody = false; renderBody = false;

@ -14,7 +14,7 @@ class Plunger extends BodyComponent with InitialPosition, Layered {
required this.compressionDistance, required this.compressionDistance,
// TODO(ruimiguel): set to priority +1 over LaunchRamp once all priorities // TODO(ruimiguel): set to priority +1 over LaunchRamp once all priorities
// are fixed. // are fixed.
}) : super(priority: PinballPriority.plunger) { }) : super(priority: RenderPriority.plunger) {
layer = Layer.launcher; layer = Layer.launcher;
} }

@ -35,7 +35,7 @@ abstract class RampOpening extends BodyComponent with InitialPosition, Layered {
}) : _insideLayer = insideLayer, }) : _insideLayer = insideLayer,
_outsideLayer = outsideLayer ?? Layer.board, _outsideLayer = outsideLayer ?? Layer.board,
_insidePriority = insidePriority, _insidePriority = insidePriority,
_outsidePriority = outsidePriority ?? PinballPriority.ballOnBoard { _outsidePriority = outsidePriority ?? RenderPriority.ballOnBoard {
layer = Layer.opening; layer = Layer.opening;
} }
final Layer _insideLayer; final Layer _insideLayer;

@ -9,7 +9,7 @@ class RocketSpriteComponent extends SpriteComponent with HasGameRef {
// TODO(ruimiguel): change this priority to be over launcher ramp and bottom // TODO(ruimiguel): change this priority to be over launcher ramp and bottom
// wall. // wall.
/// {@macro rocket_sprite_component} /// {@macro rocket_sprite_component}
RocketSpriteComponent() : super(priority: PinballPriority.rocket); RocketSpriteComponent() : super(priority: RenderPriority.rocket);
@override @override
Future<void> onLoad() async { Future<void> onLoad() async {

@ -18,7 +18,7 @@ class ScoreText extends TextComponent {
text: text, text: text,
position: position, position: position,
anchor: Anchor.center, anchor: Anchor.center,
priority: PinballPriority.scoreText, priority: RenderPriority.scoreText,
); );
late final Effect _effect; late final Effect _effect;

@ -42,7 +42,7 @@ class Slingshot extends BodyComponent with InitialPosition {
}) : _length = length, }) : _length = length,
_angle = angle, _angle = angle,
_spritePath = spritePath, _spritePath = spritePath,
super(priority: PinballPriority.slingshot); super(priority: RenderPriority.slingshot);
final double _length; final double _length;

@ -34,7 +34,7 @@ class Spaceship extends Forge2DBlueprint {
AndroidHead()..initialPosition = position, AndroidHead()..initialPosition = position,
SpaceshipHole( SpaceshipHole(
outsideLayer: Layer.spaceshipExitRail, outsideLayer: Layer.spaceshipExitRail,
outsidePriority: PinballPriority.ballOnSpaceshipRail, outsidePriority: RenderPriority.ballOnSpaceshipRail,
)..initialPosition = position - Vector2(5.2, -4.8), )..initialPosition = position - Vector2(5.2, -4.8),
SpaceshipHole()..initialPosition = position - Vector2(-7.2, -0.8), SpaceshipHole()..initialPosition = position - Vector2(-7.2, -0.8),
SpaceshipWall()..initialPosition = position, SpaceshipWall()..initialPosition = position,
@ -47,7 +47,7 @@ class Spaceship extends Forge2DBlueprint {
/// {@endtemplate} /// {@endtemplate}
class SpaceshipSaucer extends BodyComponent with InitialPosition, Layered { class SpaceshipSaucer extends BodyComponent with InitialPosition, Layered {
/// {@macro spaceship_saucer} /// {@macro spaceship_saucer}
SpaceshipSaucer() : super(priority: PinballPriority.spaceshipSaucer) { SpaceshipSaucer() : super(priority: RenderPriority.spaceshipSaucer) {
layer = Layer.spaceship; layer = Layer.spaceship;
} }
@ -91,7 +91,7 @@ class SpaceshipSaucer extends BodyComponent with InitialPosition, Layered {
/// {@endtemplate} /// {@endtemplate}
class AndroidHead extends BodyComponent with InitialPosition, Layered { class AndroidHead extends BodyComponent with InitialPosition, Layered {
/// {@macro spaceship_bridge} /// {@macro spaceship_bridge}
AndroidHead() : super(priority: PinballPriority.androidHead) { AndroidHead() : super(priority: RenderPriority.androidHead) {
layer = Layer.spaceship; layer = Layer.spaceship;
} }
@ -153,7 +153,7 @@ class SpaceshipEntrance extends RampOpening {
: super( : super(
insideLayer: Layer.spaceship, insideLayer: Layer.spaceship,
orientation: RampOrientation.up, orientation: RampOrientation.up,
insidePriority: PinballPriority.ballOnSpaceship, insidePriority: RenderPriority.ballOnSpaceship,
) { ) {
layer = Layer.spaceship; layer = Layer.spaceship;
} }
@ -187,7 +187,7 @@ class SpaceshipHole extends RampOpening {
insideLayer: Layer.spaceship, insideLayer: Layer.spaceship,
outsideLayer: outsideLayer, outsideLayer: outsideLayer,
orientation: RampOrientation.up, orientation: RampOrientation.up,
insidePriority: PinballPriority.ballOnSpaceship, insidePriority: RenderPriority.ballOnSpaceship,
outsidePriority: outsidePriority, outsidePriority: outsidePriority,
) { ) {
renderBody = false; renderBody = false;
@ -238,7 +238,7 @@ class _SpaceshipWallShape extends ChainShape {
/// {@endtemplate} /// {@endtemplate}
class SpaceshipWall extends BodyComponent with InitialPosition, Layered { class SpaceshipWall extends BodyComponent with InitialPosition, Layered {
/// {@macro spaceship_wall} /// {@macro spaceship_wall}
SpaceshipWall() : super(priority: PinballPriority.spaceshipSaucerWall) { SpaceshipWall() : super(priority: RenderPriority.spaceshipSaucerWall) {
layer = Layer.spaceship; layer = Layer.spaceship;
} }

@ -40,7 +40,7 @@ class SpaceshipRail extends Forge2DBlueprint {
/// Represents the spaceship drop rail from the [Spaceship]. /// Represents the spaceship drop rail from the [Spaceship].
class _SpaceshipRailRamp extends BodyComponent with InitialPosition, Layered { class _SpaceshipRailRamp extends BodyComponent with InitialPosition, Layered {
_SpaceshipRailRamp() : super(priority: PinballPriority.spaceshipRail) { _SpaceshipRailRamp() : super(priority: RenderPriority.spaceshipRail) {
layer = Layer.spaceshipExitRail; layer = Layer.spaceshipExitRail;
} }
@ -156,7 +156,7 @@ class _SpaceshipRailRampSpriteComponent extends SpriteComponent
class _SpaceshipRailForeground extends SpriteComponent with HasGameRef { class _SpaceshipRailForeground extends SpriteComponent with HasGameRef {
_SpaceshipRailForeground() _SpaceshipRailForeground()
: super(priority: PinballPriority.spaceshipRailForeground); : super(priority: RenderPriority.spaceshipRailForeground);
@override @override
Future<void> onLoad() async { Future<void> onLoad() async {
@ -204,7 +204,7 @@ class SpaceshipRailExit extends RampOpening {
: super( : super(
orientation: RampOrientation.down, orientation: RampOrientation.down,
insideLayer: Layer.spaceshipExitRail, insideLayer: Layer.spaceshipExitRail,
insidePriority: PinballPriority.ballOnSpaceshipRail, insidePriority: RenderPriority.ballOnSpaceshipRail,
) { ) {
renderBody = false; renderBody = false;
layer = Layer.spaceshipExitRail; layer = Layer.spaceshipExitRail;

@ -21,14 +21,14 @@ class SpaceshipRamp extends Forge2DBlueprint {
]); ]);
final rightOpening = _SpaceshipRampOpening( final rightOpening = _SpaceshipRampOpening(
outsidePriority: PinballPriority.ballOnBoard, outsidePriority: RenderPriority.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;
final leftOpening = _SpaceshipRampOpening( final leftOpening = _SpaceshipRampOpening(
outsideLayer: Layer.spaceship, outsideLayer: Layer.spaceship,
outsidePriority: PinballPriority.ballOnSpaceship, outsidePriority: RenderPriority.ballOnSpaceship,
rotation: math.pi, rotation: math.pi,
) )
..initialPosition = Vector2(-13.7, -18.6) ..initialPosition = Vector2(-13.7, -18.6)
@ -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: PinballPriority.spaceshipRamp) { _SpaceshipRampBackground() : super(priority: RenderPriority.spaceshipRamp) {
layer = Layer.spaceshipEntranceRamp; layer = Layer.spaceshipEntranceRamp;
} }
@ -125,7 +125,7 @@ class _SpaceshipRampBackground extends BodyComponent
class _SpaceshipRampBackgroundRailingSpriteComponent extends SpriteComponent class _SpaceshipRampBackgroundRailingSpriteComponent extends SpriteComponent
with HasGameRef { with HasGameRef {
_SpaceshipRampBackgroundRailingSpriteComponent() _SpaceshipRampBackgroundRailingSpriteComponent()
: super(priority: PinballPriority.spaceshipRampBackgroundRailing); : super(priority: RenderPriority.spaceshipRampBackgroundRailing);
@override @override
Future<void> onLoad() async { Future<void> onLoad() async {
await super.onLoad(); await super.onLoad();
@ -171,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: PinballPriority.spaceshipRampForegroundRailing) { : super(priority: RenderPriority.spaceshipRampForegroundRailing) {
layer = Layer.spaceshipEntranceRamp; layer = Layer.spaceshipEntranceRamp;
} }
@ -291,7 +291,7 @@ class _SpaceshipRampOpening extends RampOpening {
insideLayer: Layer.spaceshipEntranceRamp, insideLayer: Layer.spaceshipEntranceRamp,
outsideLayer: outsideLayer, outsideLayer: outsideLayer,
orientation: RampOrientation.down, orientation: RampOrientation.down,
insidePriority: PinballPriority.ballOnSpaceshipRamp, insidePriority: RenderPriority.ballOnSpaceshipRamp,
outsidePriority: outsidePriority, outsidePriority: outsidePriority,
) { ) {
renderBody = false; renderBody = false;

@ -21,7 +21,7 @@ class SparkyBumper extends BodyComponent with InitialPosition {
_activeAssetPath = activeAssetPath, _activeAssetPath = activeAssetPath,
_inactiveAssetPath = inactiveAssetPath, _inactiveAssetPath = inactiveAssetPath,
_spriteComponent = spriteComponent, _spriteComponent = spriteComponent,
super(priority: PinballPriority.sparkyBumper); super(priority: RenderPriority.sparkyBumper);
/// {@macro sparky_bumper} /// {@macro sparky_bumper}
SparkyBumper.a() SparkyBumper.a()

@ -22,7 +22,7 @@ class SparkyComputer extends Forge2DBlueprint {
} }
class _ComputerBase extends BodyComponent with InitialPosition { class _ComputerBase extends BodyComponent with InitialPosition {
_ComputerBase() : super(priority: PinballPriority.computerBase); _ComputerBase() : super(priority: RenderPriority.computerBase);
List<FixtureDef> _createFixtureDefs() { List<FixtureDef> _createFixtureDefs() {
final fixturesDef = <FixtureDef>[]; final fixturesDef = <FixtureDef>[];
@ -99,7 +99,7 @@ class _ComputerTopSpriteComponent extends SpriteComponent with HasGameRef {
: super( : super(
anchor: Anchor.center, anchor: Anchor.center,
position: Vector2(-12.45, -49.75), position: Vector2(-12.45, -49.75),
priority: PinballPriority.computerTop, priority: RenderPriority.computerTop,
); );
@override @override

@ -1,110 +1,114 @@
// ignore_for_file: public_member_api_docs
import 'dart:math' as math; import 'dart:math' as math;
import 'package:flame/components.dart'; import 'package:flame/components.dart';
import 'package:pinball_components/pinball_components.dart'; import 'package:pinball_components/pinball_components.dart';
/// {@template pinball_priority} /// {@template render_priority}
/// Priorities for the component rendering order in the pinball game. /// Priorities for the component rendering order in the pinball game.
/// {@endtemplate} /// {@endtemplate}
abstract class PinballPriority { abstract class RenderPriority {
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. /// Render priority for the [Ball] while it's on the board.
static const int ballOnBoard = base; static const int ballOnBoard = _base;
/// Render priority for the [Ball] while it's on the [SpaceshipRamp]. /// Render priority for the [Ball] while it's on the [SpaceshipRamp].
static const int ballOnSpaceshipRamp = above + spaceshipRampBackgroundRailing; static const int ballOnSpaceshipRamp =
_above + spaceshipRampBackgroundRailing;
/// Render priority for the [Ball] while it's on the [Spaceship]. /// Render priority for the [Ball] while it's on the [Spaceship].
static const int ballOnSpaceship = above + spaceshipSaucer; static const int ballOnSpaceship = _above + spaceshipSaucer;
/// Render priority for the [Ball] while it's on the [SpaceshipRail]. /// Render priority for the [Ball] while it's on the [SpaceshipRail].
static const int ballOnSpaceshipRail = spaceshipRail; static const int ballOnSpaceshipRail = spaceshipRail;
/// Render priority for the [Ball] while it's on the [LaunchRamp]. /// Render priority for the [Ball] while it's on the [LaunchRamp].
static const int ballOnLaunchRamp = above + launchRamp; static const int ballOnLaunchRamp = _above + launchRamp;
// BACKGROUND // BACKGROUND
static const int background = 3 * below + base; static const int background = 3 * _below + _base;
// BOUNDARIES // BOUNDARIES
static const int bottomBoundary = above + dinoBottomWall; static const int bottomBoundary = _above + dinoBottomWall;
static const int outerBoudary = above + background; static const int outerBoudary = _above + background;
// BOTTOM GROUP // BOTTOM GROUP
static const int bottomGroup = above + ballOnBoard; static const int bottomGroup = _above + ballOnBoard;
// LAUNCHER // LAUNCHER
static const int launchRamp = above + outerBoudary; static const int launchRamp = _above + outerBoudary;
static const int launchRampForegroundRailing = above + ballOnLaunchRamp; static const int launchRampForegroundRailing = _above + ballOnLaunchRamp;
static const int plunger = above + launchRamp; static const int plunger = _above + launchRamp;
static const int rocket = above + bottomBoundary; static const int rocket = _above + bottomBoundary;
// DINO LAND // DINO LAND
static const int dinoTopWall = above + ballOnBoard; static const int dinoTopWall = _above + ballOnBoard;
static const int dino = above + dinoTopWall; static const int dino = _above + dinoTopWall;
static const int dinoBottomWall = above + dino; static const int dinoBottomWall = _above + dino;
static const int slingshot = above + ballOnBoard; static const int slingshot = _above + ballOnBoard;
// FLUTTER FOREST // FLUTTER FOREST
static const int flutterSignPost = above + launchRampForegroundRailing; static const int flutterSignPost = _above + launchRampForegroundRailing;
static const int dashBumper = above + ballOnBoard; static const int dashBumper = _above + ballOnBoard;
static const int dashAnimatronic = above + launchRampForegroundRailing; static const int dashAnimatronic = _above + launchRampForegroundRailing;
// SPARKY FIRE ZONE // SPARKY FIRE ZONE
static const int computerBase = below + ballOnBoard; static const int computerBase = _below + ballOnBoard;
static const int computerTop = above + ballOnBoard; static const int computerTop = _above + ballOnBoard;
static const int sparkyAnimatronic = above + spaceshipRampForegroundRailing; static const int sparkyAnimatronic = _above + spaceshipRampForegroundRailing;
static const int sparkyBumper = above + ballOnBoard; static const int sparkyBumper = _above + ballOnBoard;
// ANDROID SPACESHIP // ANDROID SPACESHIP
static const int spaceshipRail = above + bottomGroup; static const int spaceshipRail = _above + bottomGroup;
static const int spaceshipRailForeground = above + spaceshipRail; static const int spaceshipRailForeground = _above + spaceshipRail;
static const int spaceshipSaucer = above + spaceshipRail; static const int spaceshipSaucer = _above + spaceshipRail;
static const int spaceshipSaucerWall = above + spaceshipSaucer; static const int spaceshipSaucerWall = _above + spaceshipSaucer;
static const int androidHead = above + spaceshipSaucer; static const int androidHead = _above + spaceshipSaucer;
static const int spaceshipRamp = above + ballOnBoard; static const int spaceshipRamp = _above + ballOnBoard;
static const int spaceshipRampBackgroundRailing = above + spaceshipRamp; static const int spaceshipRampBackgroundRailing = _above + spaceshipRamp;
static const int spaceshipRampForegroundRailing = above + ballOnSpaceshipRamp; static const int spaceshipRampForegroundRailing =
_above + ballOnSpaceshipRamp;
static const int spaceshipRampBoardOpening = below + ballOnBoard; static const int spaceshipRampBoardOpening = _below + ballOnBoard;
static const int alienBumper = above + ballOnBoard; static const int alienBumper = _above + ballOnBoard;
// SCORE TEXT // SCORE TEXT
static const int scoreText = above + spaceshipRampForegroundRailing; static const int scoreText = _above + spaceshipRampForegroundRailing;
} }
/// Helper methods to change the [priority] of a [Component]. /// Helper methods to change the [priority] of a [Component].

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

@ -9,7 +9,7 @@ class SpaceshipRailGame extends BasicBallGame {
SpaceshipRailGame() SpaceshipRailGame()
: super( : super(
color: Colors.blue, color: Colors.blue,
ballPriority: PinballPriority.ballOnSpaceshipRail, ballPriority: RenderPriority.ballOnSpaceshipRail,
ballLayer: Layer.spaceshipExitRail, ballLayer: Layer.spaceshipExitRail,
); );

@ -9,7 +9,7 @@ class SpaceshipRampGame extends BasicBallGame {
SpaceshipRampGame() SpaceshipRampGame()
: super( : super(
color: Colors.blue, color: Colors.blue,
ballPriority: PinballPriority.ballOnSpaceshipRamp, ballPriority: RenderPriority.ballOnSpaceshipRamp,
ballLayer: Layer.spaceshipEntranceRamp, ballLayer: Layer.spaceshipEntranceRamp,
); );

Loading…
Cancel
Save