diff --git a/lib/animation.dart b/lib/animation.dart index aed479f07..6147ead78 100644 --- a/lib/animation.dart +++ b/lib/animation.dart @@ -71,6 +71,7 @@ class Animation { double textureWidth, double textureHeight, double stepTime = 0.1, + this.loop = true, }) { frames = List(amount); for (var i = 0; i < amount; i++) { @@ -94,6 +95,7 @@ class Animation { double textureY = 0.0, double textureWidth, double textureHeight, + this.loop = true, }) { frames = List(amount); for (var i = 0; i < amount; i++) { diff --git a/lib/components/animation_component.dart b/lib/components/animation_component.dart index 8cc7bd003..67c3bff77 100644 --- a/lib/components/animation_component.dart +++ b/lib/components/animation_component.dart @@ -25,6 +25,7 @@ class AnimationComponent extends PositionComponent { double textureWidth, double textureHeight, double stepTime, + bool loop = true, this.destroyOnFinish = false, }) { this.width = width; @@ -37,6 +38,7 @@ class AnimationComponent extends PositionComponent { textureWidth: textureWidth, textureHeight: textureHeight, stepTime: stepTime ?? 0.1, + loop: loop, ); }