|
|
@ -44,14 +44,7 @@ class PinballGame extends Forge2DGame
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void spawnBall() {
|
|
|
|
void spawnBall() {
|
|
|
|
add(
|
|
|
|
add(Ball(position: plunger.body.position));
|
|
|
|
Ball(
|
|
|
|
|
|
|
|
position: Vector2(
|
|
|
|
|
|
|
|
plunger.body.position.x,
|
|
|
|
|
|
|
|
plunger.body.position.y + Ball.ballSize.y,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void _addContactCallbacks() {
|
|
|
|
void _addContactCallbacks() {
|
|
|
@ -138,7 +131,7 @@ class PinballGame extends Forge2DGame
|
|
|
|
position: screenToWorld(
|
|
|
|
position: screenToWorld(
|
|
|
|
Vector2(
|
|
|
|
Vector2(
|
|
|
|
camera.viewport.effectiveSize.x - 30,
|
|
|
|
camera.viewport.effectiveSize.x - 30,
|
|
|
|
camera.viewport.effectiveSize.y - Plunger.compressionDistance,
|
|
|
|
camera.viewport.effectiveSize.y,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|