chore: rename animationCooldown

pull/452/head
Allison Ryan 3 years ago
parent 484b97d89b
commit 90b012c33d

@ -4,8 +4,8 @@ import 'package:pinball_flame/pinball_flame.dart';
class AnimatronicLoopingBehavior extends TimerComponent
with ParentIsA<SpriteAnimationComponent> {
AnimatronicLoopingBehavior({
required double durationBetweenAnimation,
}) : super(period: durationBetweenAnimation);
required double animationCooldown,
}) : super(period: animationCooldown);
@override
Future<void> onLoad() async {

@ -42,7 +42,7 @@ class FlutterForest extends Component with ZIndex {
)..initialPosition = Vector2(21.8, -46.75),
DashAnimatronic(
children: [
AnimatronicLoopingBehavior(durationBetweenAnimation: 4),
AnimatronicLoopingBehavior(animationCooldown: 4),
],
)..position = Vector2(20, -66),
FlutterForestBonusBehavior(),

@ -35,7 +35,7 @@ class SparkyScorch extends Component {
)..initialPosition = Vector2(-3.3, -52.55),
SparkyAnimatronic(
children: [
AnimatronicLoopingBehavior(durationBetweenAnimation: 3),
AnimatronicLoopingBehavior(animationCooldown: 3),
],
)..position = Vector2(-14, -58.2),
SparkyComputer(

@ -28,7 +28,7 @@ void main() {
group('AnimatronicLoopingBehavior', () {
test('can be instantiated', () {
expect(
AnimatronicLoopingBehavior(durationBetweenAnimation: 1),
AnimatronicLoopingBehavior(animationCooldown: 1),
isA<AnimatronicLoopingBehavior>(),
);
});
@ -36,8 +36,7 @@ void main() {
flameTester.test(
'can be added',
(game) async {
final behavior =
AnimatronicLoopingBehavior(durationBetweenAnimation: 1);
final behavior = AnimatronicLoopingBehavior(animationCooldown: 1);
final animation = _MockSpriteAnimation();
final spriteAnimationComponent = _TestSpriteAnimationComponent()
..animation = animation;
@ -53,8 +52,7 @@ void main() {
flameTester.test(
'onTick starts playing the animation',
(game) async {
final behavior =
AnimatronicLoopingBehavior(durationBetweenAnimation: 1);
final behavior = AnimatronicLoopingBehavior(animationCooldown: 1);
final spriteAnimationComponent = _TestSpriteAnimationComponent();
await game.ensureAdd(spriteAnimationComponent);
await spriteAnimationComponent.add(behavior);
@ -69,8 +67,7 @@ void main() {
flameTester.test(
'animation onComplete resets and stops playing the animation',
(game) async {
final behavior =
AnimatronicLoopingBehavior(durationBetweenAnimation: 1);
final behavior = AnimatronicLoopingBehavior(animationCooldown: 1);
final spriteAnimationComponent = DashAnimatronic();
await game.ensureAdd(spriteAnimationComponent);
@ -89,8 +86,7 @@ void main() {
flameTester.test(
'animation onComplete resets and starts the timer',
(game) async {
final behavior =
AnimatronicLoopingBehavior(durationBetweenAnimation: 1);
final behavior = AnimatronicLoopingBehavior(animationCooldown: 1);
final spriteAnimationComponent = DashAnimatronic();
await game.ensureAdd(spriteAnimationComponent);

Loading…
Cancel
Save