diff --git a/lib/effects/effects.dart b/lib/effects/effects.dart index ea31b677d..658351182 100644 --- a/lib/effects/effects.dart +++ b/lib/effects/effects.dart @@ -39,10 +39,10 @@ abstract class PositionComponentEffect { double get totalTravelTime => travelTime * (isAlternating ? 2 : 1); PositionComponentEffect( - this._initialIsInfinite, - this._initialIsAlternating, { - this.onComplete, - }) { + this._initialIsInfinite, + this._initialIsAlternating, { + this.onComplete, + }) { isInfinite = _initialIsInfinite; isAlternating = _initialIsAlternating; } @@ -58,7 +58,7 @@ abstract class PositionComponentEffect { if (!hasFinished()) { currentTime += dt * curveDirection + driftTime * driftMultiplier; percentage = min(1.0, max(0.0, currentTime / travelTime)); - if (hasFinished()){ + if (hasFinished()) { onComplete?.call(); } } diff --git a/lib/effects/move_effect.dart b/lib/effects/move_effect.dart index edb9f84a8..21681c6be 100644 --- a/lib/effects/move_effect.dart +++ b/lib/effects/move_effect.dart @@ -22,14 +22,14 @@ class MoveEffect extends PositionComponentEffect { double _yDistance; double _yDirection; - MoveEffect({ - @required this.destination, - @required this.speed, - this.curve, - isInfinite = false, - isAlternating = false, - Function onComplete - }) : super(isInfinite, isAlternating, onComplete: onComplete); + MoveEffect( + {@required this.destination, + @required this.speed, + this.curve, + isInfinite = false, + isAlternating = false, + Function onComplete}) + : super(isInfinite, isAlternating, onComplete: onComplete); @override void initialize(_comp) {