diff --git a/lib/game/bloc/game_bloc.dart b/lib/game/bloc/game_bloc.dart index 28c04902..507c4a51 100644 --- a/lib/game/bloc/game_bloc.dart +++ b/lib/game/bloc/game_bloc.dart @@ -19,7 +19,13 @@ class GameBloc extends Bloc { } void _onBallLost(BallLost event, Emitter emit) { - emit(state.copyWith(balls: state.balls - 1)); + emit( + state.copyWith( + balls: state.balls - 1, + score: state.score * state.multiplier, + multiplier: 1, + ), + ); } void _onScored(Scored event, Emitter emit) { @@ -32,8 +38,6 @@ class GameBloc extends Bloc { void _onIncreasedMultiplier(MultiplierIncreased event, Emitter emit) { if (!state.isGameOver) { - // TODO(ruimiguel): confirm that x6 is going to be the max value, to add - // assertion here or at MultiplierIncreased event const. emit(state.copyWith(multiplier: state.multiplier + 1)); } } diff --git a/lib/game/bloc/game_event.dart b/lib/game/bloc/game_event.dart index 7b30aace..7a22f415 100644 --- a/lib/game/bloc/game_event.dart +++ b/lib/game/bloc/game_event.dart @@ -55,6 +55,8 @@ class SparkyTurboChargeActivated extends GameEvent { class MultiplierIncreased extends GameEvent { /// {@macro multiplier_increased_game_event} const MultiplierIncreased(); + // TODO(ruimiguel): confirm that x6 is going to be the max value, to add + // assertion here @override List get props => [];