refactor: comments and sizing

pull/204/head
Allison Ryan 3 years ago
parent 354641b414
commit 1be30ebd25

@ -78,14 +78,13 @@ class AlienBumper extends BodyComponent with InitialPosition {
} }
} }
@visibleForTesting
/// Indicates the [AlienBumper]'s current sprite state. /// Indicates the [AlienBumper]'s current sprite state.
@visibleForTesting
enum AlienBumperSpriteState { enum AlienBumperSpriteState {
/// The active sprite is being displayed. /// A lit up bumper.
active, active,
/// The inactive sprite is being displayed. /// A dimmed bumper.
inactive, inactive,
} }
@ -115,8 +114,8 @@ class _AlienBumperSpriteGroupComponent
Sprite(gameRef.images.fromCache(_offAssetPath)), Sprite(gameRef.images.fromCache(_offAssetPath)),
}; };
this.sprites = sprites; this.sprites = sprites;
size = sprites.entries.first.value.originalSize / 10;
current = AlienBumperSpriteState.active; current = AlienBumperSpriteState.active;
size = sprites[current]!.originalSize / 10;
} }
} }

@ -93,14 +93,13 @@ class DashNestBumper extends BodyComponent with InitialPosition {
} }
} }
@visibleForTesting
/// Indicates the [DashNestBumper]'s current sprite state. /// Indicates the [DashNestBumper]'s current sprite state.
@visibleForTesting
enum DashNestBumperSpriteState { enum DashNestBumperSpriteState {
/// The active sprite is being displayed. /// A lit up bumper.
active, active,
/// The inactive sprite is being displayed. /// A dimmed bumper.
inactive, inactive,
} }
@ -130,8 +129,8 @@ class _DashNestBumperSpriteGroupComponent
Sprite(gameRef.images.fromCache(_inactiveAssetPath)), Sprite(gameRef.images.fromCache(_inactiveAssetPath)),
}; };
this.sprites = sprites; this.sprites = sprites;
size = sprites[DashNestBumperSpriteState.inactive]!.originalSize / 10;
current = DashNestBumperSpriteState.inactive; current = DashNestBumperSpriteState.inactive;
size = sprites[current]!.originalSize / 10;
} }
} }

@ -93,14 +93,13 @@ class SparkyBumper extends BodyComponent with InitialPosition {
} }
} }
@visibleForTesting
/// Indicates the [SparkyBumper]'s current sprite state. /// Indicates the [SparkyBumper]'s current sprite state.
@visibleForTesting
enum SparkyBumperSpriteState { enum SparkyBumperSpriteState {
/// The active sprite is being displayed. /// A lit up bumper.
active, active,
/// The inactive sprite is being displayed. /// A dimmed bumper.
inactive, inactive,
} }
@ -130,8 +129,8 @@ class _SparkyBumperSpriteGroupComponent
Sprite(gameRef.images.fromCache(_offAssetPath)), Sprite(gameRef.images.fromCache(_offAssetPath)),
}; };
this.sprites = sprites; this.sprites = sprites;
size = sprites.entries.first.value.originalSize / 10;
current = SparkyBumperSpriteState.active; current = SparkyBumperSpriteState.active;
size = sprites[current]!.originalSize / 10;
} }
} }

Loading…
Cancel
Save