@@ -20,28 +20,25 @@ class Enemy extends SpriteComponent
2020 super .anchor,
2121 super .priority,
2222 }) : super .fromImage (
23- srcPosition: Vector2 (1 * 32 , 0 ),
24- srcSize: Vector2 .all (32 ),
25- position: position,
26- ) {
23+ srcPosition: Vector2 (1 * 32 , 0 ),
24+ srcSize: Vector2 .all (32 ),
25+ position: position,
26+ ) {
2727 if (targetPosition != null && position != null ) {
2828 // Need to sequence two move to effects so that we can
2929 // tap into the onFinishCallback and flip the component.
30- final effect = SequenceEffect (
31- [
32- MoveToEffect (
33- targetPosition,
34- EffectController (speed: 100 ),
35- onComplete: flipHorizontallyAroundCenter,
36- ),
37- MoveToEffect (
38- position + Vector2 (32 , 0 ), // Need to offset by 32 due to flip
39- EffectController (speed: 100 ),
40- onComplete: flipHorizontallyAroundCenter,
41- ),
42- ],
43- infinite: true ,
44- );
30+ final effect = SequenceEffect ([
31+ MoveToEffect (
32+ targetPosition,
33+ EffectController (speed: 100 ),
34+ onComplete: flipHorizontallyAroundCenter,
35+ ),
36+ MoveToEffect (
37+ position + Vector2 (32 , 0 ), // Need to offset by 32 due to flip
38+ EffectController (speed: 100 ),
39+ onComplete: flipHorizontallyAroundCenter,
40+ ),
41+ ], infinite: true );
4542
4643 add (effect);
4744 }
0 commit comments