diff --git a/lib/game/components/ramp_opening.dart b/lib/game/components/ramp_opening.dart index ed1cb64d..96b1ec15 100644 --- a/lib/game/components/ramp_opening.dart +++ b/lib/game/components/ramp_opening.dart @@ -80,7 +80,6 @@ class RampOpeningBallContactCallback ball.layer = layer; } else { ballsInside.remove(ball); - ball.layer = Layer.board; } } @@ -96,5 +95,6 @@ class RampOpeningBallContactCallback if (isBallOutsideOpening) ball.layer = Layer.board; */ + if (!ballsInside.contains(ball)) ball.layer = Layer.board; } } diff --git a/test/game/components/ramp_opening_test.dart b/test/game/components/ramp_opening_test.dart index 75b76e31..abd38d47 100644 --- a/test/game/components/ramp_opening_test.dart +++ b/test/game/components/ramp_opening_test.dart @@ -251,8 +251,8 @@ void main() { expect(callback.ballsInside.first, ball); // TODO(ruimiguel): check what happens with ball that slightly touch - // Opening and goes out again. With InitialPosition change now doesn't work - // position.y comparison + // Opening and goes out again. With InitialPosition change now doesn't + // work position.y comparison callback.end(ball, area, MockContact()); //expect(callback.ballsInside.isEmpty, true); }); @@ -282,8 +282,8 @@ void main() { verify(() => ball.layer = Layer.jetpack).called(1); // TODO(ruimiguel): check what happens with ball that slightly touch - // Opening and goes out again. With InitialPosition change now doesn't work - // position.y comparison + // Opening and goes out again. With InitialPosition change now doesn't + // work position.y comparison callback.end(ball, area, MockContact()); //verify(() => ball.layer = Layer.board); });