Skip to content

Commit

Permalink
Update win/lose/draw audio files and play
Browse files Browse the repository at this point in the history
Thanks Matt Littlewood

Change-Id: I6b1952039da3a2f1bdeb553a158f185f7edd8c55
  • Loading branch information
calcitem committed Dec 30, 2023
1 parent 0c75b0d commit 17b6792
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
Binary file modified src/ui/flutter_app/assets/audios/draw.mp3
Binary file not shown.
Binary file modified src/ui/flutter_app/assets/audios/lose.mp3
Binary file not shown.
Binary file modified src/ui/flutter_app/assets/audios/win.mp3
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,20 @@ class GameResultAlertDialog extends StatelessWidget {
// TODO: Why sometimes _gameResult is null?
position.result = _gameResult;

switch (position.result) {
case GameResult.win:
SoundManager().playTone(Sound.win);
break;
case GameResult.draw:
SoundManager().playTone(Sound.draw);
break;
case GameResult.lose:
SoundManager().playTone(Sound.lose);
break;
case null:
break;
}

final String dialogTitle = _gameResult!.winString(context);

final bool isTopLevel =
Expand Down

0 comments on commit 17b6792

Please sign in to comment.