refactor: add rotation to multiball constructor

pull/235/head
RuiAlonso 3 years ago
parent b1cf524935
commit 51de4da0f1

@ -19,7 +19,8 @@ class Multiball extends Component {
position: position, position: position,
onAssetPath: onAssetPath, onAssetPath: onAssetPath,
offAssetPath: offAssetPath, offAssetPath: offAssetPath,
)..angle = rotation, rotation: rotation,
),
], ],
); );
@ -92,11 +93,13 @@ class MultiballSpriteGroupComponent
required Vector2 position, required Vector2 position,
required String onAssetPath, required String onAssetPath,
required String offAssetPath, required String offAssetPath,
required double rotation,
}) : _onAssetPath = onAssetPath, }) : _onAssetPath = onAssetPath,
_offAssetPath = offAssetPath, _offAssetPath = offAssetPath,
super( super(
anchor: Anchor.center, anchor: Anchor.center,
position: position, position: position,
angle: rotation,
); );
final String _onAssetPath; final String _onAssetPath;

@ -58,7 +58,7 @@ void main() {
final multiball = Multiball.d(); final multiball = Multiball.d();
await game.ensureAdd(multiball); await game.ensureAdd(multiball);
multiball.animate(); await multiball.animate();
await tester.pump(); await tester.pump();
expect( expect(

Loading…
Cancel
Save