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)));
await add( final machine = [
PinballCanvasComponent(
children: [
BoardBackgroundSpriteComponent(), BoardBackgroundSpriteComponent(),
Multipliers(), Boundaries(),
Drain(), Backboard.waiting(position: Vector2(0, -88)),
BottomGroup(), ];
Launcher(), final decals = [
FlutterForest(),
GoogleWord( GoogleWord(
position: Vector2( position: Vector2(
BoardDimensions.bounds.center.dx - 4.1, BoardDimensions.bounds.center.dx - 4.1,
BoardDimensions.bounds.center.dy + 1.8, BoardDimensions.bounds.center.dy + 1.8,
), ),
), ),
Slingshots(), Multipliers(),
Boundaries(), ];
final characterAreas = [
AndroidAcres(),
DinoDesert(), DinoDesert(),
FlutterForest(),
SparkyScorch(), SparkyScorch(),
AndroidAcres(), ];
await add(
PinballCanvasComponent(
children: [
...machine,
...decals,
...characterAreas,
Drain(),
BottomGroup(),
Launcher(),
], ],
), ),
); );

Loading…
Cancel
Save