Apply suggestions from code review

Co-authored-by: Alejandro Santiago <dev@alestiago.com>
Co-authored-by: Allison Ryan <77211884+allisonryan0002@users.noreply.github.com>
pull/160/head
Erick 4 years ago committed by Erick Zanardo
parent 04a31c2b7f
commit 35d72e0fe8

@ -2,13 +2,15 @@ import 'package:flame/components.dart';
import 'package:pinball_components/pinball_components.dart'; import 'package:pinball_components/pinball_components.dart';
/// {@template backboard} /// {@template backboard}
/// The [Backboard] of the pinball machine /// The [Backboard] of the pinball machine.
/// {@endtemplate} /// {@endtemplate}
class Backboard extends SpriteComponent with HasGameRef { class Backboard extends SpriteComponent with HasGameRef {
/// {@macro backboard} /// {@macro backboard}
Backboard({ Backboard({
required Vector2 position, required Vector2 position,
}) : super( }) : super(
// TODO(erickzanardo): remove multiply after
// https://github.com/flame-engine/flame/pull/1506 is merged
position: position..clone().multiply(Vector2(1, -1)), position: position..clone().multiply(Vector2(1, -1)),
anchor: Anchor.bottomCenter, anchor: Anchor.bottomCenter,
); );
@ -18,7 +20,7 @@ class Backboard extends SpriteComponent with HasGameRef {
await waitingMode(); await waitingMode();
} }
/// Sets the Backboard on the waiting mode, where the scoreboard is show /// Puts the Backboard in waiting mode, where the scoreboard is shown.
Future<void> waitingMode() async { Future<void> waitingMode() async {
size = Vector2(120, 100); size = Vector2(120, 100);
sprite = await gameRef.loadSprite( sprite = await gameRef.loadSprite(
@ -26,7 +28,7 @@ class Backboard extends SpriteComponent with HasGameRef {
); );
} }
/// Sets the Backboard on the game over mode, where the score input is show /// Puts the Backboard in game over mode, where the score input is shown.
Future<void> gameOverMode() async { Future<void> gameOverMode() async {
size = Vector2(100, 100); size = Vector2(100, 100);
sprite = await gameRef.loadSprite( sprite = await gameRef.loadSprite(

Loading…
Cancel
Save