refactor: reordered children additions

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

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

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

Loading…
Cancel
Save