feat: adding bonus score to the user when they complete the bonus

pull/36/head
Erick Zanardo 4 years ago
parent 03d48eac40
commit b0eb6cabf6

@ -15,6 +15,7 @@ class GameBloc extends Bloc<GameEvent, GameState> {
}
static const bonusWord = 'GOOGLE';
static const bonusWordScore = 10000;
void _onBallLost(BallLost event, Emitter emit) {
if (state.balls > 0) {
@ -37,6 +38,7 @@ class GameBloc extends Bloc<GameEvent, GameState> {
if (newBonusLetters.length == bonusWord.length) {
emit(
state.copyWith(
score: state.score + bonusWordScore,
activatedBonusLetters: [],
bonusHistory: [
...state.bonusHistory,

@ -172,7 +172,7 @@ void main() {
bonusHistory: [],
),
GameState(
score: 0,
score: GameBloc.bonusWordScore,
balls: 3,
activatedBonusLetters: [],
bonusHistory: [GameBonus.word],

Loading…
Cancel
Save