chore: small changes

pull/319/head
Allison Ryan 3 years ago
parent a09c4dd9d3
commit 56e03bed94

@ -19,21 +19,21 @@ class GameFlowController extends ComponentController<PinballGame>
@override
void onNewState(GameState state) {
if (state.isGameOver) {
initialsInput();
_initialsInput();
} else {
start();
}
}
/// Puts the game in the initials input state.
void initialsInput() {
void _initialsInput() {
// TODO(erickzanardo): implement score submission and "navigate" to the
// next page
component.descendants().whereType<Backbox>().first.initialsInput(
score: state?.score ?? 0,
characterIconPath: component.characterTheme.leaderboardIcon.keyName,
);
component.firstChild<CameraController>()?.focusOnGameOverBackbox();
component.firstChild<CameraController>()!.focusOnGameOverBackbox();
}
/// Puts the game in the playing state.

@ -61,25 +61,22 @@ void main() {
},
);
group('renders correctly', () {
flameTester.testGameWidget(
'empty',
'renders correctly',
setUp: (game, tester) async {
await game.images.loadAll(assets);
game.camera.zoom = 6;
game.camera.followVector2(Vector2(0, -130));
await game.ensureAdd(Backbox());
await game.ready();
await tester.pump();
},
verify: (game, tester) async {
await expectLater(
find.byGame<EmptyPinballTestGame>(),
matchesGoldenFile('../golden/backbox/empty.png'),
matchesGoldenFile('../golden/backbox.png'),
);
},
);
});
flameTester.test(
'initialsInput adds InitialsInputDisplay',

Before

Width:  |  Height:  |  Size: 1.4 MiB

After

Width:  |  Height:  |  Size: 1.4 MiB

Loading…
Cancel
Save