refactor: removed plunger parameter

pull/111/head
alestiago 4 years ago
parent 58f2031580
commit 7443a65823

@ -17,12 +17,7 @@ class ControlledBall extends Ball with Controls<BallController> {
/// count, and a new [Ball] is spawned at the [Plunger].
ControlledBall.launch({
required PinballTheme theme,
required Plunger plunger,
}) : super(baseColor: theme.characterTheme.ballColor) {
initialPosition = Vector2(
plunger.body.position.x,
plunger.body.position.y + Ball.size.y,
);
controller = LaunchedBallController(this);
}

@ -103,8 +103,10 @@ class PinballGame extends Forge2DGame
void spawnBall() {
final ball = ControlledBall.launch(
theme: theme,
plunger: plunger,
);
)..initialPosition = Vector2(
plunger.body.position.x,
plunger.body.position.y + Ball.size.y,
);
add(ball);
}
}

Loading…
Cancel
Save