From a75dc5351351087d71ce2bad8fe55f38f8a6979d Mon Sep 17 00:00:00 2001 From: alestiago Date: Wed, 2 Mar 2022 13:19:28 +0000 Subject: [PATCH] refactor: replaced vector instances --- test/game/components/ball_test.dart | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/test/game/components/ball_test.dart b/test/game/components/ball_test.dart index 7b41cde4..be0c1e3e 100644 --- a/test/game/components/ball_test.dart +++ b/test/game/components/ball_test.dart @@ -10,8 +10,7 @@ void main() { FlameTester(PinballGame.new).test( 'loads correctly', (game) async { - final position = Vector2(10, 10); - final ball = Ball(position: position); + final ball = Ball(position: Vector2.zero()); await game.ensureAdd(ball); expect(game.contains(ball), isTrue); @@ -22,7 +21,7 @@ void main() { FlameTester(PinballGame.new).test( 'positions correctly', (game) async { - final position = Vector2(10, 10); + final position = Vector2.all(10); final ball = Ball(position: position); await game.ensureAdd(ball); game.contains(ball); @@ -34,8 +33,7 @@ void main() { FlameTester(PinballGame.new).test( 'is dynamic', (game) async { - final position = Vector2(10, 10); - final ball = Ball(position: position); + final ball = Ball(position: Vector2.zero()); await game.ensureAdd(ball); expect(ball.body.bodyType, equals(BodyType.dynamic)); @@ -47,8 +45,7 @@ void main() { FlameTester(PinballGame.new).test( 'exists', (game) async { - final position = Vector2(10, 10); - final ball = Ball(position: position); + final ball = Ball(position: Vector2.zero()); await game.ensureAdd(ball); expect(ball.body.fixtures.length, equals(1)); @@ -58,8 +55,7 @@ void main() { FlameTester(PinballGame.new).test( 'is dense', (game) async { - final position = Vector2(10, 10); - final ball = Ball(position: position); + final ball = Ball(position: Vector2.zero()); await game.ensureAdd(ball); final fixture = ball.body.fixtures[0]; @@ -70,8 +66,7 @@ void main() { FlameTester(PinballGame.new).test( 'shape is circular', (game) async { - final position = Vector2(10, 10); - final ball = Ball(position: position); + final ball = Ball(position: Vector2.zero()); await game.ensureAdd(ball); final fixture = ball.body.fixtures[0];