@@ -20,28 +20,27 @@ class Enemy extends SpriteComponent
20
20
super .anchor,
21
21
super .priority,
22
22
}) : 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
+ ) {
27
27
if (targetPosition != null && position != null ) {
28
28
// Need to sequence two move to effects so that we can
29
29
// 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
+ ],
42
+ infinite: true ,
43
+ );
45
44
46
45
add (effect);
47
46
}
0 commit comments