Skip to content

Commit

Permalink
audio: New win/lose/draw mp3
Browse files Browse the repository at this point in the history
Thanks Matt Littlewood.

Change-Id: I0949c1757d21c5c41412d06bd0b80af3ccfcb464
  • Loading branch information
calcitem committed Jan 1, 2024
1 parent abdb16a commit bcf3c45
Show file tree
Hide file tree
Showing 7 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 added src/ui/flutter_app/assets/audios/draw.wav
Binary file not shown.
Binary file modified src/ui/flutter_app/assets/audios/lose.mp3
Binary file not shown.
Binary file added src/ui/flutter_app/assets/audios/lose.wav
Binary file not shown.
Binary file modified src/ui/flutter_app/assets/audios/win.mp3
Binary file not shown.
Binary file added src/ui/flutter_app/assets/audios/win.wav
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 bcf3c45

Please sign in to comment.