Skip to content

Commit

Permalink
trying to fix audio
Browse files Browse the repository at this point in the history
  • Loading branch information
PScottZero committed Jun 10, 2021
1 parent 851840c commit 8e2d639
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 7 deletions.
Binary file added assets/audio/piece_moved.mp3
Binary file not shown.
Binary file removed assets/audio/piece_moved.ogg
Binary file not shown.
7 changes: 1 addition & 6 deletions lib/logic/chess_piece_sprite.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:audioplayers/audioplayers.dart';
import 'package:en_passant/model/app_model.dart';
import 'package:en_passant/views/components/main_menu_view/game_options/side_picker.dart';
import 'package:flame/components.dart';
Expand All @@ -19,10 +18,6 @@ class ChessPieceSprite {
double offsetX = 0;
double offsetY = 0;

AudioPlayer audioPlayer = AudioPlayer();
AudioCache audioCache = AudioCache();
var pieceMovedSound;

ChessPieceSprite(ChessPiece piece, String pieceTheme) {
this.tile = piece.tile;
this.type = piece.type;
Expand Down Expand Up @@ -67,7 +62,7 @@ class ChessPieceSprite {
void playSound(double destX, double destY, AppModel appModel) async {
if ((destX - spriteX).abs() <= 0.1 && (destY - spriteY).abs() <= 0.1) {
if (appModel.soundEnabled) {
FlameAudio.play('piece_moved.ogg');
FlameAudio.play('piece_moved.mp3');
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,4 @@ flutter:
- assets/images/pieces/videochess/
- assets/images/pieces/lewischessmen/
- assets/images/pieces/mexicocity/
- assets/audio/piece_moved.ogg
- assets/audio/piece_moved.mp3

0 comments on commit 8e2d639

Please sign in to comment.