refactor: reordered children additions

pull/282/head
alestiago 3 years ago
parent e3ae725690
commit eb9ba59a9e

@ -16,6 +16,7 @@ class DinoDesert extends Component {
children: [ children: [
// ChromeDino()..initialPosition = Vector2(12.3, -6.9), // ChromeDino()..initialPosition = Vector2(12.3, -6.9),
DinoWalls(), DinoWalls(),
Slingshots(),
], ],
); );
} }

@ -44,28 +44,37 @@ class PinballGame extends Forge2DGame
Future<void> onLoad() async { Future<void> onLoad() async {
await add(gameFlowController = GameFlowController(this)); await add(gameFlowController = GameFlowController(this));
await add(CameraController(this)); await add(CameraController(this));
await add(Backboard.waiting(position: Vector2(0, -88)));
final machine = [
BoardBackgroundSpriteComponent(),
Boundaries(),
Backboard.waiting(position: Vector2(0, -88)),
];
final decals = [
GoogleWord(
position: Vector2(
BoardDimensions.bounds.center.dx - 4.1,
BoardDimensions.bounds.center.dy + 1.8,
),
),
Multipliers(),
];
final characterAreas = [
AndroidAcres(),
DinoDesert(),
FlutterForest(),
SparkyScorch(),
];
await add( await add(
PinballCanvasComponent( PinballCanvasComponent(
children: [ children: [
BoardBackgroundSpriteComponent(), ...machine,
Multipliers(), ...decals,
...characterAreas,
Drain(), Drain(),
BottomGroup(), BottomGroup(),
Launcher(), Launcher(),
FlutterForest(),
GoogleWord(
position: Vector2(
BoardDimensions.bounds.center.dx - 4.1,
BoardDimensions.bounds.center.dy + 1.8,
),
),
Slingshots(),
Boundaries(),
DinoDesert(),
SparkyScorch(),
AndroidAcres(),
], ],
), ),
); );

Loading…
Cancel
Save