|
|
@ -13,11 +13,10 @@ class RampMultiplierBehavior extends Component
|
|
|
|
SpaceshipRampState previousState,
|
|
|
|
SpaceshipRampState previousState,
|
|
|
|
SpaceshipRampState newState,
|
|
|
|
SpaceshipRampState newState,
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
final hasChanged =
|
|
|
|
final hitsIncreased = previousState.hits < newState.hits;
|
|
|
|
previousState.hits != newState.hits && newState.hits != 0;
|
|
|
|
|
|
|
|
final achievedFiveShots = newState.hits % 5 == 0;
|
|
|
|
final achievedFiveShots = newState.hits % 5 == 0;
|
|
|
|
final canIncrease = readBloc<GameBloc, GameState>().state.multiplier != 6;
|
|
|
|
final canIncrease = readBloc<GameBloc, GameState>().state.multiplier != 6;
|
|
|
|
return hasChanged && achievedFiveShots && canIncrease;
|
|
|
|
return hitsIncreased & achievedFiveShots && canIncrease;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|