|
|
|
@ -99,9 +99,6 @@ class _GameBallsController extends ComponentController<PinballGame>
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
bool listenWhen(GameState? previousState, GameState newState) {
|
|
|
|
|
//final noBallsLeft = component.descendants().whereType<Ball>().isEmpty;
|
|
|
|
|
//final canBallRespawn = newState.balls > 0;
|
|
|
|
|
|
|
|
|
|
final noBallsLeft = newState.balls == 0;
|
|
|
|
|
final canBallRespawn = newState.rounds > 0;
|
|
|
|
|
|
|
|
|
@ -183,15 +180,6 @@ class DebugPinballGame extends PinballGame with FPSCounter, TapDetector {
|
|
|
|
|
|
|
|
|
|
class _DebugGameBallsController extends _GameBallsController {
|
|
|
|
|
_DebugGameBallsController(PinballGame game) : super(game);
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
bool listenWhen(GameState? previousState, GameState newState) {
|
|
|
|
|
final noBallsLeft =
|
|
|
|
|
component.descendants().whereType<ControlledBall>().isEmpty;
|
|
|
|
|
final canBallRespawn = newState.balls > 0;
|
|
|
|
|
|
|
|
|
|
return noBallsLeft && canBallRespawn;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _DebugInformation extends Component with HasGameRef<DebugPinballGame> {
|
|
|
|
|