feat: adding bonus score to the user when they complete the bonus (#36)

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

* feat: pr suggestions
pull/45/head
Erick 4 years ago committed by GitHub
parent 1539ab7bd3
commit 1754602634
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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) {
@ -44,6 +45,7 @@ class GameBloc extends Bloc<GameEvent, GameState> {
],
),
);
add(const Scored(points: bonusWordScore));
} else {
emit(
state.copyWith(activatedBonusLetters: newBonusLetters),

@ -177,6 +177,12 @@ void main() {
activatedBonusLetters: [],
bonusHistory: [GameBonus.word],
),
GameState(
score: GameBloc.bonusWordScore,
balls: 3,
activatedBonusLetters: [],
bonusHistory: [GameBonus.word],
),
],
);
});

Loading…
Cancel
Save